Move to rustdoc instead of ruby's middleman
authorAlex Crichton <alex@alexcrichton.com>
Sun, 7 Sep 2014 17:53:20 +0000 (10:53 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 10 Sep 2014 23:20:01 +0000 (16:20 -0700)
* All markdown files are now rendered with `rustdoc` into HTML
* A JS syntax highlighter, prism, is included for TOML syntax highlighting.
* A new makefile target, `make doc`, will build docs into `target/doc`

40 files changed:
.travis.yml
Makefile.in
configure
src/doc/CNAME [new file with mode: 0644]
src/doc/Gemfile [deleted file]
src/doc/Gemfile.lock [deleted file]
src/doc/config.md [new file with mode: 0644]
src/doc/config.rb [deleted file]
src/doc/faq.md [new file with mode: 0644]
src/doc/footer.html [new file with mode: 0644]
src/doc/guide.md [new file with mode: 0644]
src/doc/header.html [new file with mode: 0644]
src/doc/images/Cargo-Logo-Small.png [new file with mode: 0644]
src/doc/images/forkme.png [new file with mode: 0644]
src/doc/images/noise.png [new file with mode: 0644]
src/doc/index.md [new file with mode: 0644]
src/doc/javascripts/all.js [new file with mode: 0644]
src/doc/javascripts/prism.js [new file with mode: 0644]
src/doc/manifest.md [new file with mode: 0644]
src/doc/native-build.md [new file with mode: 0644]
src/doc/source/CNAME [deleted file]
src/doc/source/config.md [deleted file]
src/doc/source/faq.md [deleted file]
src/doc/source/guide.md [deleted file]
src/doc/source/images/Cargo-Logo-Small.png [deleted file]
src/doc/source/images/forkme.png [deleted file]
src/doc/source/images/noise.png [deleted file]
src/doc/source/index.md [deleted file]
src/doc/source/javascripts/all.js [deleted file]
src/doc/source/layouts/layout.erb [deleted file]
src/doc/source/manifest.md [deleted file]
src/doc/source/native-build.md [deleted file]
src/doc/source/stylesheets/all.css.scss [deleted file]
src/doc/source/stylesheets/colors.css.scss [deleted file]
src/doc/source/stylesheets/fonts.css.scss [deleted file]
src/doc/source/stylesheets/normalize.css [deleted file]
src/doc/source/stylesheets/solarized.css.scss [deleted file]
src/doc/stylesheets/all.css [new file with mode: 0644]
src/doc/stylesheets/normalize.css [new file with mode: 0644]
src/doc/stylesheets/prism.css [new file with mode: 0644]

index 598fa6024abed4ff69cca9e26a7bfa9c0952844c..0872cef5f20d52069ac63d707adeac106602fe6f 100644 (file)
@@ -6,16 +6,14 @@ script:
   - make
   - make test
   - make distcheck
+  - make doc
 after_success: |
   [ $TRAVIS_BRANCH = master ] &&
   [ $TRAVIS_PULL_REQUEST = false ] &&
   [ $BITS = 64 ] &&
   [ $(uname -s) = Linux ] &&
-  (cd src/doc &&
-   bundle &&
-   bundle exec middleman build) &&
   sudo pip install ghp-import &&
-  ghp-import -n src/doc/build &&
+  ghp-import -n target/doc &&
   git push -f https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
 env:
   matrix:
index 47f7656fc0ffef7997dab275204d20274d75e446..e02333fa515eab05590cb0a76f45d18775d72ed3 100644 (file)
@@ -96,6 +96,31 @@ clean-all: clean
 clean:
        rm -rf $(TARGET_ROOT)
 
+# === Documentation
+
+DOCS := index faq config guide manifest native-build
+DOC_DIR := target/doc
+DOC_OPTS := --markdown-no-toc \
+               --markdown-css stylesheets/normalize.css \
+               --markdown-css stylesheets/all.css \
+               --markdown-css stylesheets/prism.css \
+               --html-before-content src/doc/header.html \
+               --html-after-content src/doc/footer.html
+ASSETS := CNAME images/noise.png images/forkme.png images/Cargo-Logo-Small.png \
+       stylesheets/all.css stylesheets/normalize.css javascripts/prism.js \
+       javascripts/all.js stylesheets/prism.css
+
+doc: $(foreach doc,$(DOCS),target/doc/$(doc).html) \
+       $(foreach asset,$(ASSETS),target/doc/$(asset))
+
+$(DOC_DIR)/%.html: src/doc/%.md src/doc/header.html src/doc/footer.html
+       @mkdir -p $(@D)
+       "$(CFG_RUSTDOC)" $< -o $(@D) $(DOC_OPTS)
+
+$(DOC_DIR)/%: src/doc/%
+       @mkdir -p $(@D)
+       cp $< $@
+
 # === Distribution
 
 define DO_DIST_TARGET
index a263e55c407f977d07611e7cc7fad35aee2fe0b1..bb0085b99b6408b3dee1a83834d2fdc09e997104 100755 (executable)
--- a/configure
+++ b/configure
@@ -342,6 +342,12 @@ step_msg "looking for build programs"
 probe_need CFG_CURLORWGET  curl wget
 probe_need CFG_PYTHON      python
 
+if [ ! -z "${CFG_LOCAL_RUST_ROOT}" ]; then
+    CFG_RUSTDOC="${CFG_LOCAL_RUST_ROOT}/bin/rustdoc"
+else
+    probe_need CFG_RUSTDOC        rustdoc
+fi
+
 # a little post-processing of various config values
 CFG_PREFIX=${CFG_PREFIX%/}
 CFG_MANDIR=${CFG_MANDIR%/}
@@ -372,6 +378,7 @@ putvar CFG_TARGET
 putvar CFG_LIBDIR
 putvar CFG_MANDIR
 putvar CFG_RUSTC
+putvar CFG_RUSTDOC
 
 msg
 copy_if_changed ${CFG_SRC_DIR}Makefile.in ./Makefile
diff --git a/src/doc/CNAME b/src/doc/CNAME
new file mode 100644 (file)
index 0000000..cbcca7c
--- /dev/null
@@ -0,0 +1 @@
+crates.io
diff --git a/src/doc/Gemfile b/src/doc/Gemfile
deleted file mode 100644 (file)
index afd0d1a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# If you have OpenSSL installed, we recommend updating
-# the following line to use "https"
-source 'http://rubygems.org'
-
-gem "middleman", "~>3.3.3"
-gem "middleman-blog"
-
-gem "middleman-syntax"
-gem "redcarpet"
-
-# Live-reloading plugin
-gem "middleman-livereload", "~> 3.1.0"
-
-# For faster file watcher updates on Windows:
-gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
-
-# Windows does not come with time zone data
-gem "tzinfo-data", platforms: [:mswin, :mingw]
diff --git a/src/doc/Gemfile.lock b/src/doc/Gemfile.lock
deleted file mode 100644 (file)
index 4ba15d2..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-GEM
-  remote: http://rubygems.org/
-  specs:
-    activesupport (4.1.1)
-      i18n (~> 0.6, >= 0.6.9)
-      json (~> 1.7, >= 1.7.7)
-      minitest (~> 5.1)
-      thread_safe (~> 0.1)
-      tzinfo (~> 1.1)
-    addressable (2.3.6)
-    chunky_png (1.3.1)
-    coffee-script (2.2.0)
-      coffee-script-source
-      execjs
-    coffee-script-source (1.7.0)
-    compass (0.12.6)
-      chunky_png (~> 1.2)
-      fssm (>= 0.2.7)
-      sass (~> 3.2.19)
-    compass-import-once (1.0.4)
-      sass (>= 3.2, < 3.5)
-    em-websocket (0.5.1)
-      eventmachine (>= 0.12.9)
-      http_parser.rb (~> 0.6.0)
-    erubis (2.7.0)
-    eventmachine (1.0.3)
-    execjs (2.2.0)
-    ffi (1.9.3)
-    fssm (0.2.10)
-    haml (4.0.5)
-      tilt
-    hike (1.2.3)
-    hooks (0.4.0)
-      uber (~> 0.0.4)
-    http_parser.rb (0.6.0)
-    i18n (0.6.9)
-    json (1.8.1)
-    kramdown (1.4.0)
-    listen (1.3.1)
-      rb-fsevent (>= 0.9.3)
-      rb-inotify (>= 0.9)
-      rb-kqueue (>= 0.2)
-    middleman (3.3.3)
-      coffee-script (~> 2.2.0)
-      compass (>= 0.12.4)
-      compass-import-once (= 1.0.4)
-      execjs (~> 2.0)
-      haml (>= 4.0.5)
-      kramdown (~> 1.2)
-      middleman-core (= 3.3.3)
-      middleman-sprockets (>= 3.1.2)
-      sass (>= 3.2.17, < 4.0)
-      uglifier (~> 2.5)
-    middleman-blog (3.5.3)
-      addressable (~> 2.3.5)
-      middleman-core (~> 3.2)
-      tzinfo (>= 0.3.0)
-    middleman-core (3.3.3)
-      activesupport (~> 4.1.0)
-      bundler (~> 1.1)
-      erubis
-      hooks (~> 0.3)
-      i18n (~> 0.6.9)
-      listen (~> 1.1)
-      padrino-helpers (~> 0.12.1)
-      rack (>= 1.4.5, < 2.0)
-      rack-test (~> 0.6.2)
-      thor (>= 0.15.2, < 2.0)
-      tilt (~> 1.4.1, < 2.0)
-    middleman-livereload (3.1.1)
-      em-websocket (>= 0.2.0)
-      middleman-core (>= 3.0.2)
-      multi_json (~> 1.0)
-      rack-livereload
-    middleman-sprockets (3.3.3)
-      middleman-core (>= 3.2)
-      sprockets (~> 2.2)
-      sprockets-helpers (~> 1.1.0)
-      sprockets-sass (~> 1.1.0)
-    middleman-syntax (2.0.0)
-      middleman-core (~> 3.2)
-      rouge (~> 1.0)
-    minitest (5.3.5)
-    multi_json (1.10.1)
-    padrino-helpers (0.12.2)
-      i18n (~> 0.6, >= 0.6.7)
-      padrino-support (= 0.12.2)
-      tilt (~> 1.4.1)
-    padrino-support (0.12.2)
-      activesupport (>= 3.1)
-    rack (1.5.2)
-    rack-livereload (0.3.15)
-      rack
-    rack-test (0.6.2)
-      rack (>= 1.0)
-    rb-fsevent (0.9.4)
-    rb-inotify (0.9.5)
-      ffi (>= 0.5.0)
-    rb-kqueue (0.2.3)
-      ffi (>= 0.5.0)
-    redcarpet (2.3.0)
-    rouge (1.4.0)
-    sass (3.2.19)
-    sprockets (2.12.1)
-      hike (~> 1.2)
-      multi_json (~> 1.0)
-      rack (~> 1.0)
-      tilt (~> 1.1, != 1.3.0)
-    sprockets-helpers (1.1.0)
-      sprockets (~> 2.0)
-    sprockets-sass (1.1.0)
-      sprockets (~> 2.0)
-      tilt (~> 1.1)
-    thor (0.19.1)
-    thread_safe (0.3.4)
-    tilt (1.4.1)
-    tzinfo (1.2.1)
-      thread_safe (~> 0.1)
-    uber (0.0.6)
-    uglifier (2.5.1)
-      execjs (>= 0.3.0)
-      json (>= 1.8.0)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  middleman (~> 3.3.3)
-  middleman-blog
-  middleman-livereload (~> 3.1.0)
-  middleman-syntax
-  redcarpet
-  tzinfo-data
-  wdm (~> 0.1.0)
diff --git a/src/doc/config.md b/src/doc/config.md
new file mode 100644 (file)
index 0000000..721ace2
--- /dev/null
@@ -0,0 +1,67 @@
+% Configuration
+
+This document will explain how cargo's configuration system works, as well as
+available keys or configuration.  For configuration of a project through its
+manfest, see the [manifest format](manifest.html).
+
+# Hierarchical structure
+
+Cargo allows to have local configuration for a particular project or global
+configuration (like git). Cargo also extends this ability to a hirearchical
+strategy. If, for example, cargo were invoked in `/home/foo/bar/baz`, then the
+following configuration files would be probed for:
+
+* `/home/foo/bar/baz/.cargo/config`
+* `/home/foo/bar/.cargo/config`
+* `/home/foo/.cargo/config`
+* `/home/.cargo/config`
+* `/.cargo/config`
+
+With this structure you can specify local configuration per-project, and even
+possibly check it into version control. You can also specify personal default
+with a configuration file in your home directory.
+
+# Configuration Format
+
+All configuration is currently in the TOML format (like the manifest), with
+simple key-value pairs inside of sections (tables) which all get merged
+together.
+
+# Configuration keys
+
+All of the following keys are optional, and their defaults are listed as their
+value unless otherwise noted.
+
+```toml
+# An array of paths to local repositories which are to be used as overrides for
+# dependencies. For more information see the Cargo Guide.
+paths = [ "/path/to/override" ]
+
+[cargo-new]
+# This is your name/email to place in the `authors` section of a new Cargo.toml
+# that is generated. If not present, then `git` will be probed, and if that is
+# not present then `$USER` will be used (with no email).
+name = "..."
+email = "..."
+
+# By default `cargo new` will initialize a new git repository. This key can be
+# set to `false` to disable this behavior.
+git = true
+
+# For the following sections, $triple refers to any valid target triple, not the
+# literal string "$triple", and it will apply whenever that target triple is
+# being compiled to.
+[target]
+
+# For cargo builds which do not mention --target, these are the ar/linker which
+# are passed to rustc to use (via `-C ar=` and `-C linker=`). By default these
+# flags are not passed to the compiler.
+ar = ".."
+linker = ".."
+
+[target.$triple]
+# Similar to the above ar/linker configuration, but this only applies to when
+# the `$triple` is being compiled for.
+ar = ".."
+linker = ".."
+```
diff --git a/src/doc/config.rb b/src/doc/config.rb
deleted file mode 100644 (file)
index fe4d7f2..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-###
-# Compass
-###
-
-# Change Compass configuration
-# compass_config do |config|
-#   config.output_style = :compact
-# end
-
-###
-# Page options, layouts, aliases and proxies
-###
-
-# Per-page layout changes:
-#
-# With no layout
-# page "/path/to/file.html", :layout => false
-#
-# With alternative layout
-# page "/path/to/file.html", :layout => :otherlayout
-#
-# A path which all have the same layout
-# with_layout :admin do
-#   page "/admin/*"
-# end
-
-# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
-# proxy "/this-page-has-no-template.html", "/template-file.html", :locals => {
-#  :which_fake_page => "Rendering a fake page with a local variable" }
-
-###
-# Helpers
-###
-
-# Automatic image dimensions on image_tag helper
- activate :automatic_image_sizes
-
-# Reload the browser automatically whenever files change
-configure :development do
-  activate :livereload
-end
-
-# Methods defined in the helpers block are available in templates
-# helpers do
-#   def some_helper
-#     "Helping"
-#   end
-# end
-
-activate :syntax
-
-set :css_dir, 'stylesheets'
-
-set :js_dir, 'javascripts'
-
-set :images_dir, 'images'
-
-set :fonts_dir, 'fonts'
-
-set :markdown_engine, :redcarpet
-set :markdown, :fenced_code_blocks => true, :smartypants => true
-
-set :relative_links, true
-
-ignore "**/*.ttf"
-
-# Build-specific configuration
-configure :build do
-  # For example, change the Compass output style for deployment
-  # activate :minify_css
-
-  # Minify Javascript on build
-  # activate :minify_javascript
-
-  # Enable cache buster
-  # activate :asset_hash
-
-  # Use relative URLs
-  activate :relative_assets
-
-  # Or use a different image path
-  # set :http_prefix, "/Content/images/"
-end
diff --git a/src/doc/faq.md b/src/doc/faq.md
new file mode 100644 (file)
index 0000000..5c6e057
--- /dev/null
@@ -0,0 +1,139 @@
+% Frequently Asked Questions
+
+# Is the plan to use Github as a package repository?
+
+No. The plan for Cargo is to have a central registry of packages, like
+npm or Rubygems.
+
+We plan to support git repositories as a source of packages forever,
+because they can be used for early development and temporary patches,
+even when people use the registry as the primary source of packages.
+
+At the moment, the Rust team is still making regular changes to the
+language, and the Rust project recommends using nightly builds. This
+means that for now, package authors make regular changes in order to
+track the latest Rust. This makes downloading the latest `master` from
+Github the best approach to getting packages at the current point in the
+community's lifecycle.
+
+# Why build a package registry rather than use Github as a registry?
+
+We think that it's very important to support multiple ways to download
+packages, including downloading from Github and copying packages into
+your project itself.
+
+That said, we think that a central registry offers a number of important
+benefits, and will likely become the primary way that people download
+packages in Cargo.
+
+For precedent, both Node.js's [npm][1] and Ruby's [bundler][2] support both a
+central registry model as well as a Git-based model, and most packages
+are downloaded through the registry in those ecosystems, with an
+important minority of packages making use of git-based packages.
+
+[1]: https://www.npmjs.org
+[2]: https://bundler.io
+
+Some of the advantages that make a central registry popular in other
+languages include:
+
+* **Discoverability**. A central registry provides an easy place to look
+  for existing packages. Combined with tagging, this also makes it
+  possible for a registry to provide ecosystem-wide information, such as a
+  list of the most popular or most-depended-on packages.
+* **Speed**. A central registry makes it possible to easily fetch just
+  the metadata for packages quickly and efficiently, and then to
+  efficiently download just the published package, and not other bloat
+  that happens to exist in the repository. This adds up to a significant
+  improvement in the speed of dependency resolution and fetching. As
+  dependency graphs scale up, downloading all of the git repositories bogs
+  down fast. Also remember that not everybody has a high-speed,
+  low-latency Internet connection.
+
+# Will Cargo work with C code (or other languages)?
+
+Yes!
+
+Cargo handles compiling Rust code, but we know that many Rust projects
+link against C code. We also know that there are decades of tooling
+built up around compiling languages other than Rust.
+
+Our solution: Cargo allows a package to specify a script to run
+before invoking `rustc`. We plan to add support for platform-specific
+configuration, so you can use `make` on Linux and `cmake` on BSD, for
+example.
+
+# Can Cargo be used inside of `make` (or `ninja`, or ...)
+
+Indeed. While we intend Cargo to be useful as a standalone way to
+compile Rust projects at the top-level, we know that some people will
+want to invoke Cargo from other build tools.
+
+We have designed Cargo to work well in those contexts, paying attention
+to things like error codes and machine-readable output modes. We still
+have some work to do on those fronts, but using Cargo in the context of
+conventional scripts is something we designed for from the beginning and
+will continue to prioritize.
+
+# Does Cargo handle multi-platform projects or cross-compilation?
+
+Rust itself provides facilities for configuring sections of code based
+on the platform. We plan to support per-platform configuration in
+`Cargo.toml`, including platform-specific dependencies, in the near
+future.
+
+In the longer-term, we're looking at ways to conveniently cross-compile
+projects using Cargo.
+
+# Does Cargo support environments, like `production` or `test`?
+
+We are planning on support environments in the near future, that can
+support:
+
+* environment-specific flags (like `-g --opt-level=0` for development
+  and `--opt-level=3` for production).
+* environment-specific dependencies (like `hamcrest` for test assertions).
+* environment-specific `#[cfg]`
+* a `cargo test` command
+
+We also plan to make it possible to specify "profiles", which can
+specify flags or dependencies for a combination of multiple environments
+and platforms ("use `fsevents`, but only in OSX in `development` or
+`test`").
+
+# Does Cargo work on Windows?
+
+Yes!
+
+All commits to Cargo are required to pass the local test suite on Windows.
+If, however, you find a Windows issue, we consider it a bug, so [please file an
+issue][3].
+
+[3]: https://github.com/rust-lang/cargo/issues
+
+# Why do binaries have `Cargo.lock` in version control, but not libraries?
+
+The purpose of a `Cargo.lock` is to describe the state of the world at the time
+of a successful build. It is then used to provide deterministic builds across
+whatever machine is building the project by ensuring that the exact same
+dependencies are being compiled.
+
+This property is most desirable from applications and projects which are at the
+very end of the dependency chain (binaries). As a result, it is recommended that
+all binaries check in their `Cargo.lock`.
+
+For libraries the situation is somewhat different. A library is not only used by
+the library developers, but also any downstream consumers of the library. Users
+dependent on the library will not inspect the library's `Cargo.lock` (even if it
+exists). This is precisely because a library should **not** be deterministically
+recompiled for all users of the library.
+
+If a library ends up being used transitively by several dependencies, it's
+likely that just a single copy of the library is desired (based on semver
+compatibility). If all libraries were to check in their `Cargo.lock`, then
+multiple copies of the library would be used, and perhaps even a version
+conflict.
+
+In other words, libraries specify semver requirements for their dependencies but
+cannot see the full picture. Only end products like binaries have a full
+picture to decide what versions of dependencies should be used.
diff --git a/src/doc/footer.html b/src/doc/footer.html
new file mode 100644 (file)
index 0000000..040a6ee
--- /dev/null
@@ -0,0 +1,11 @@
+  <footer>
+    <a href='guide.html'>Guide</a> |
+    <a href='faq.html'>Frequently Asked Questions</a> |
+    <a href='manifest.html'>Manifest Format</a> |
+    <a href='native-build.html'>Building Non-Rust Code</a> |
+    <a href='config.html'>Configuration</a>
+  </footer>
+</main>
+
+<script type='text/javascript' src='javascripts/prism.js'></script>
+<script type='text/javascript' src='javascripts/all.js'></script>
diff --git a/src/doc/guide.md b/src/doc/guide.md
new file mode 100644 (file)
index 0000000..107fbb6
--- /dev/null
@@ -0,0 +1,399 @@
+% Guide
+
+Welcome to the Cargo guide. This guide will give you all that you need to know
+about how to use Cargo to develop Rust projects.
+
+# Why Cargo exists
+
+Cargo is a tool that allows Rust projects to declare their various
+dependencies, and ensure that you'll always get a repeatable build.
+
+To accomplish this goal, Cargo does four things:
+
+* Introduces two metadata files with various bits of project information.
+* Fetches and builds your project's dependencies.
+* Invokes `rustc` or another build tool with the correct parameters to build your project.
+* Introduces conventions, making working with Rust projects easier.
+
+# Converting to Cargo
+
+You can convert an existing Rust project to use Cargo. You'll have to create a
+`Cargo.toml` file with all of your dependencies, and move your source files and
+test files into the places where Cargo expects them to be. See the [manifest
+description](/manifest.html) and the "Cargo Conventions" section below for more
+details.
+
+# Creating A New Project
+
+To start a new project with Cargo, use `cargo new`:
+
+```shell
+$ cargo new hello_world --bin
+```
+
+We're passing `--bin` because we're making a binary program: if we
+were making a library, we'd leave it off. If you'd like to not initialize a new
+git repository as well (the default), you can also pass `--no-git`.
+
+Let's check out what Cargo has generated for us:
+
+```shell
+$ cd hello_world
+$ tree .
+.
+├── Cargo.toml
+└── src
+    â””── main.rs
+
+1 directory, 2 files
+```
+
+This is all we need to get started. First, let's check out `Cargo.toml`:
+
+```toml
+[package]
+
+name = "hello_world"
+version = "0.0.1"
+authors = ["Your Name <you@example.com>"]
+```
+
+This is called a **manifest**, and it contains all of the metadata that Cargo
+needs to compile your project.
+
+Here's what's in `src/main.rs`:
+
+```
+fn main() {
+    println!("Hello, world!")
+}
+```
+
+Cargo generated a 'hello world' for us. Let's compile it:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo build
+<span style="font-weight: bold"
+class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)</code></pre>
+
+And then run it:
+
+```shell
+$ ./target/hello_world
+Hello, world!
+```
+
+We can also use `cargo run` to compile and then run it, all in one step:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo run
+<span style="font-weight: bold"
+class="s1">     Fresh</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
+<span style="font-weight: bold"
+class="s1">   Running</span> `target/hello_world`
+Hello, world!</code></pre>
+
+You'll now notice a new file, `Cargo.lock`. It contains information about our
+dependencies. Since we don't have any yet, it's not very interesting.
+
+# Working on an existing Cargo project
+
+If you download an existing project that uses Cargo, it's really easy
+to get going.
+
+First, get the project from somewhere. In this example, we'll use `color-rs`:
+
+```sh
+$ git clone https://github.com/bjz/color-rs.git
+$ cd color-rs
+```
+
+To build, just use `cargo build`:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo build
+<span style="font-weight: bold" class="s1">   Compiling</span> color v0.0.1 (file:///path/to/project/color-rs)</code></pre>
+
+This will fetch all of the dependencies and then build them, along with the
+project.
+
+# Adding Dependencies
+
+To depend on a library, add it to your `Cargo.toml`.
+
+```toml
+[package]
+
+name = "hello_world"
+version = "0.0.1"
+authors = ["Your Name <you@example.com>"]
+
+[dependencies.color]
+
+git = "https://github.com/bjz/color-rs.git"
+```
+
+You added the `color` library, which provides simple conversions
+between different color types.
+
+Now, you can pull in that library using `extern crate` in
+`main.rs`.
+
+```
+extern crate color;
+
+use color::{Rgb, ToHsv};
+
+fn main() {
+    println!("Converting RGB to HSV!");
+    let red = Rgb::new(255u8, 0, 0);
+    println!("HSV: {}", red.to_hsv::<f32>());
+}
+```
+
+Let's tell Cargo to fetch this new dependency and update the `Cargo.lock`:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo update color
+<span style="font-weight: bold" class="s1">    Updating</span> git repository `https://github.com/bjz/color-rs.git`</code></pre>
+
+Compile it:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo run
+<span style="font-weight: bold" class="s1">   Compiling</span> color v0.0.1 (https://github.com/bjz/color-rs.git#bf739419)
+<span style="font-weight: bold" class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
+<span style="font-weight: bold" class="s1">     Running</span> `target/hello_world`
+Converting RGB to HSV!
+HSV: HSV { h: 0, s: 1, v: 1 }</code></pre>
+
+We just specified a `git` repository for our dependency, but our `Cargo.lock`
+contains the exact information about which revision we used:
+
+```toml
+[root]
+name = "hello_world"
+version = "0.0.1"
+dependencies = [
+ "color 0.0.1 (git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98)",
+]
+
+[[package]]
+name = "color"
+version = "0.0.1"
+source = "git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98"
+
+```
+
+Now, if `color-rs` gets updated, we will still build with the same revision, until
+we choose to `cargo update` again.
+
+# Cargo Conventions
+
+Cargo uses conventions to make it easy to dive into a new Cargo project. Here
+are the conventions that Cargo uses:
+
+* `Cargo.toml` and `Cargo.lock` are stored in the root of your project.
+* Source code goes in the `src` directory.
+* External tests go in the `tests` directory.
+* The default executable file is `src/main.rs`.
+* Other executables can be placed in `src/bin/*.rs`.
+* The default library file is `src/lib.rs`.
+
+# Cargo.toml vs Cargo.lock
+
+`Cargo.toml` and `Cargo.lock` serve two different purposes. Before we talk
+about them, here's a summary:
+
+* `Cargo.toml` is about describing your dependencies in a broad sense, and is written by you.
+* `Cargo.lock` contains exact information about your dependencies, and is maintained by Cargo.
+* If you're building a library, put `Cargo.lock` in your `.gitignore`.
+* If you're building an executable, check `Cargo.lock` into `git`.
+
+Let's dig in a little bit more.
+
+`Cargo.toml` is a **manifest** file. In the manifest, we can specify a bunch of
+different metadata about our project. For example, we can say that we depend
+on another project:
+
+```toml
+[package]
+
+name = "hello_world"
+version = "0.0.1"
+authors = ["Your Name <you@example.com>"]
+
+[dependencies.color]
+
+git = "https://github.com/bjz/color-rs.git"
+```
+
+This project has a single dependency, on the `color` library. We've stated in
+this case that we're relying on a particular Git repository that lives on
+GitHub. Since we haven't specified any other information, Cargo assumes that
+we intend to use the latest commit on the `master` branch to build our project.
+
+Sound good? Well, there's one problem: If you build this project today, and
+then you send a copy to me, and I build this project tomorrow, something bad
+could happen. `bjz` could update `color-rs` in the meantime, and my build would
+include this commit, while yours would not. Therefore, we would get different
+builds. This would be bad, because we want reproducible builds.
+
+We could fix this problem by putting a `rev` line in our `Cargo.toml`:
+
+```toml
+[dependencies.color]
+
+git = "https://github.com/bjz/color-rs.git"
+rev = "bf739419e2d31050615c1ba1a395b474269a4"
+```
+
+Now, our builds will be the same. But, there's a big drawback: now we have to
+manually think about SHA-1s every time we want to update our library. This is
+both tedius and error prone.
+
+Enter the `Cargo.lock`. Because of its existence, we don't need to manually
+keep track of the exact revisions: Cargo will do it for us. When we have a
+manifest like this:
+
+```toml
+[package]
+
+name = "hello_world"
+version = "0.0.1"
+authors = ["Your Name <you@example.com>"]
+
+[dependencies.color]
+
+git = "https://github.com/bjz/color-rs.git"
+```
+
+Cargo will take the latest commit, and write that information out into our
+`Cargo.lock` when we build for the first time. That file will look like this:
+
+```toml
+[root]
+name = "hello_world"
+version = "0.0.1"
+dependencies = [
+ "color 0.0.1 (git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98)",
+]
+
+[[package]]
+name = "color"
+version = "0.0.1"
+source = "git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98"
+
+```
+
+You can see that there's a lot more information here, including the exact
+revision we used to build. Now, when you give your project to someone else,
+they'll use the exact same SHA, even though we didn't specify it in our
+`Cargo.toml`.
+
+When we're ready to opt in to a new version of the library, Cargo can
+re-calculate the dependencies, and update things for us:
+
+```shell
+$ cargo update       # updates all dependencies
+$ cargo update color # updates just 'color'
+```
+
+This will write out a new `Cargo.lock` with the new version information.
+
+# Overriding Dependencies
+
+Sometimes, you may want to override one of Cargo's dependencies. For example,
+let's say you're working on a project, `conduit-static`, which depends on
+the package `conduit`. You find a bug in `conduit`, and you want to write a
+patch. Here's what `conduit-static`'s `Cargo.toml` looks like:
+
+```toml
+[package]
+
+name = "conduit-static"
+version = "0.0.1"
+authors = ["Yehuda Katz <wycats@example.com>"]
+
+[dependencies.conduit]
+
+git = "https://github.com/conduit-rust/conduit.git"
+```
+
+You check out a local copy of `conduit`, let's say in your `~/src` directory:
+
+```shell
+$ cd ~/src
+$ git clone https://github.com/conduit-rust/conduit.git
+```
+
+You'd like to have `conduit-static` use your local version of `conduit`,
+rather than the one on GitHub, while you fix the bug.
+
+Cargo solves this problem by allowing you to have a local configuration
+that specifies an **override**. If Cargo finds this configuration when
+building your package, it will use the override on your local machine
+instead of the source specified in your `Cargo.toml`.
+
+Cargo looks for a directory named `.cargo` up the directory hierarchy of
+your project. If your project is in `/path/to/project/conduit-static`,
+it will search for a `.cargo` in:
+
+* `/path/to/project/conduit-static`
+* `/path/to/project`
+* `/path/to`
+* `/path`
+* `/`
+
+This allows you to specify your overrides in a parent directory that
+includes commonly used packages that you work on locally, and share them
+with all projects.
+
+To specify overrides, create a `.cargo/config` file in some ancestor of
+your project's directory (common places to put it is in the root of
+your code directory or in your home directory).
+
+Inside that file, put this:
+
+```
+paths = ["/path/to/project/conduit"]
+```
+
+This array should be filled with directories that contain a `Cargo.toml`. In
+this instance, we're just adding `conduit`, so it will be the only one that's
+overridden.
+
+More information about local configuration can be found in the [configuration
+documentation](config.html).
+
+# Tests
+
+Cargo can run your tests with the `cargo test` command. Cargo runs tests in two
+places: in each of your `src` files, and any tests in `tests/`. Tests
+in your `src` files should be unit tests, and tests in `tests/` should be
+integration-style tests. As such, you'll need to import your crates into
+the files in `tests`.
+
+To run your tests, just run `cargo test`:
+
+<pre><code class="language-shell"><span class="gp">$</span> cargo test
+<span style="font-weight: bold"
+class="s1">   Compiling</span> color v0.0.1 (https://github.com/bjz/color-rs.git#bf739419)
+<span style="font-weight: bold"
+class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
+<span style="font-weight: bold"
+class="s1">     Running</span> target/test/hello_world-9c2b65bbb79eabce
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
+</code></pre>
+
+Of course, if your project has tests, you'll see more output, with the
+correct number of tests.
+
+## Travis-CI
+
+To test your project on Travis-CI, here is a sample `.travis.yml` file:
+
+```
+language: rust
+script:
+  - cargo build --verbose
+  - cargo test --verbose
+```
diff --git a/src/doc/header.html b/src/doc/header.html
new file mode 100644 (file)
index 0000000..de0b5d2
--- /dev/null
@@ -0,0 +1,11 @@
+
+<a href='https://github.com/rust-lang/cargo' class='fork-me'>
+  <img src='images/forkme.png'/>
+</a>
+<a href='index.html' class='logo'><img src='images/Cargo-Logo-Small.png'/></a>
+
+<main>
+  <p>
+    Cargo downloads your <a href="http://rust-lang.org">Rust</a>
+    project's dependencies and builds your project
+  </p>
diff --git a/src/doc/images/Cargo-Logo-Small.png b/src/doc/images/Cargo-Logo-Small.png
new file mode 100644 (file)
index 0000000..eca9665
Binary files /dev/null and b/src/doc/images/Cargo-Logo-Small.png differ
diff --git a/src/doc/images/forkme.png b/src/doc/images/forkme.png
new file mode 100644 (file)
index 0000000..100aad0
Binary files /dev/null and b/src/doc/images/forkme.png differ
diff --git a/src/doc/images/noise.png b/src/doc/images/noise.png
new file mode 100644 (file)
index 0000000..545d930
Binary files /dev/null and b/src/doc/images/noise.png differ
diff --git a/src/doc/index.md b/src/doc/index.md
new file mode 100644 (file)
index 0000000..1df9fc7
--- /dev/null
@@ -0,0 +1,89 @@
+% Cargo, Rust's Package Manager
+
+# Installing
+
+The easiest way to get Cargo is to get the Rust nightly build by using
+the `rustup` script:
+
+```shell
+$ curl https://static.rust-lang.org/rustup.sh | sudo bash
+```
+
+This will get you the latest Rust nightly for your platform along with
+the latest Cargo. You should run this script almost every day to get the latest updates.
+
+If you are on Windows, you can directly download the latest [Rust](http://static.rust-lang.org/dist/rust-nightly-install.exe)
+and [Cargo](http://static.rust-lang.org/cargo-dist/cargo-nightly-i686-pc-mingw32.tar.gz) nightlies.
+
+Alternatively, you can build Cargo from source.
+
+# Let's Get Started
+
+To start a new project with Cargo, use `cargo new`:
+
+```shell
+$ cargo new hello_world --bin
+```
+
+We're passing `--bin` because we're making a binary program: if we
+were making a library, we'd leave it off.
+
+Let's check out what Cargo has generated for us:
+
+```shell
+$ cd hello_world
+$ tree .
+.
+├── Cargo.toml
+└── src
+    â””── main.rs
+
+1 directory, 2 files
+```
+
+This is all we need to get started. First, let's check out `Cargo.toml`:
+
+```toml
+[package]
+
+name = "hello_world"
+version = "0.0.1"
+authors = ["Your Name <you@example.com>"]
+```
+
+This is called a **manifest**, and it contains all of the metadata that Cargo
+needs to compile your project.
+
+Here's what's in `src/main.rs`:
+
+```
+fn main() {
+    println!("Hello, world!")
+}
+```
+
+Cargo generated a 'hello world' for us. Let's compile it:
+
+<pre><code class="language-shell">$ cargo build
+<span style="font-weight: bold"
+class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)</code></pre>
+
+And then run it:
+
+```shell
+$ ./target/hello_world
+Hello, world!
+```
+
+We can also use `cargo run` to compile and then run it, all in one step:
+
+<pre><code class="language-shell">$ cargo run
+<span style="font-weight: bold"
+class="s1">     Fresh</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
+<span style="font-weight: bold"
+class="s1">   Running</span> `target/hello_world`
+Hello, world!</code></pre>
+
+# Going Further
+
+For more details on using Cargo, check out the [Cargo Guide](/guide.html)
diff --git a/src/doc/javascripts/all.js b/src/doc/javascripts/all.js
new file mode 100644 (file)
index 0000000..7951c14
--- /dev/null
@@ -0,0 +1,28 @@
+//= require_tree .
+
+Prism.languages.toml = {
+  'string': /("|')(\\?.)*?\1/g,
+  'comment': /#.*/,
+  // 'atrule': {
+  //   pattern: /@[\w-]+?.*?(;|(?=\s*{))/gi,
+  //   inside: {
+  //     'punctuation': /[;:]/g
+  //   }
+  // },
+  // 'url': /url\((["']?).*?\1\)/gi,
+  // 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/g,
+  // 'property': /(\b|\B)[\w-]+(?=\s*:)/ig,
+  // 'punctuation': /[\{\};:]/g,
+  // 'function': /[-a-z0-9]+(?=\()/ig
+  'number': /\d+/,
+  'boolean': /true|false/,
+  'toml-section': /\[.*\]/,
+  'toml-key': /[\w-]+/
+};
+
+(function() {
+  var pres = document.querySelectorAll('pre.rust');
+  for (var i = 0; i < pres.length; i++) {
+    pres[i].className += ' language-rust';
+  }
+})();
diff --git a/src/doc/javascripts/prism.js b/src/doc/javascripts/prism.js
new file mode 100644 (file)
index 0000000..13c2407
--- /dev/null
@@ -0,0 +1,6 @@
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
+self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{};var Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var i=r[e],l={};for(var o in i)if(i.hasOwnProperty(o)){if(o==n)for(var s in a)a.hasOwnProperty(s)&&(l[s]=a[s]);l[o]=i[o]}return r[e]=l},DFS:function(e,n){for(var a in e)n.call(e,a,e[a]),"Object"===t.util.type(e)&&t.languages.DFS(e[a],n)}},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),i=0;a=r[i++];)t.highlightElement(a,e===!0,n)},highlightElement:function(a,r,i){for(var l,o,s=a;s&&!e.test(s.className);)s=s.parentNode;if(s&&(l=(s.className.match(e)||[,""])[1],o=t.languages[l]),o){a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,s=a.parentNode,/pre/i.test(s.nodeName)&&(s.className=s.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var c=a.textContent;if(c){var g={element:a,language:l,grammar:o,code:c};if(t.hooks.run("before-highlight",g),r&&self.Worker){var u=new Worker(t.filename);u.onmessage=function(e){g.highlightedCode=n.stringify(JSON.parse(e.data),l),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(g.element),t.hooks.run("after-highlight",g)},u.postMessage(JSON.stringify({language:g.language,code:g.code}))}else g.highlightedCode=t.highlight(g.code,g.grammar,g.language),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(a),t.hooks.run("after-highlight",g)}}},highlight:function(e,a,r){var i=t.tokenize(e,a);return n.stringify(t.util.encode(i),r)},tokenize:function(e,n){var a=t.Token,r=[e],i=n.rest;if(i){for(var l in i)n[l]=i[l];delete n.rest}e:for(var l in n)if(n.hasOwnProperty(l)&&n[l]){var o=n[l];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var c=o[s],g=c.inside,u=!!c.lookbehind,f=0,h=c.alias;c=c.pattern||c;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){c.lastIndex=0;var m=c.exec(d);if(m){u&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("[object Array]"==Object.prototype.toString.call(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!self.document)return self.addEventListener?(self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),self.close()},!1),self.Prism):self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);;
+Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/\&#?[\da-z]{1,8};/gi},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))});;
+Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/gi,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,punctuation:/[\{\};:]/g,"function":/[-a-z0-9]+(?=\()/gi},Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/gi,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/gi,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
+Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//g,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*?(\r?\n|$)/g,lookbehind:!0}],string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/gi,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/gi,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/gi,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/gi,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
diff --git a/src/doc/manifest.md b/src/doc/manifest.md
new file mode 100644 (file)
index 0000000..87a9aeb
--- /dev/null
@@ -0,0 +1,243 @@
+% The Manifest Format
+
+# The `[package]` Section
+
+The first section in a `Cargo.toml` is `[package]`.
+
+```toml
+[package]
+name = "hello_world" # the name of the package
+version = "0.0.1"    # the current version, obeying semver
+authors = [ "you@example.com" ]
+```
+
+All three of these fields are mandatory. Cargo bakes in the concept of
+[Semantic Versioning](http://semver.org/), so make sure you follow some
+basic rules:
+
+* Before you reach 1.0.0, anything goes.
+* After 1.0.0, only make breaking changes when you increment the major
+  version. In Rust, breaking changes include adding fields to structs or
+  variants to enums. Don't break the build.
+* After 1.0.0, don't add any new public API (no new `pub` anything) in
+  tiny versions. Always increment the minor version if you add any new
+  `pub` structs, traits, fields, types, functions, methods or anything else.
+* Use version numbers with three numeric parts such as 1.0.0 rather than 1.0.
+
+## The `build` Field (optional)
+
+You can specify a script that Cargo should execute before invoking
+`rustc`. You can use this to compile C code that you will [link][1] into
+your Rust code, for example. More information can be found in the building
+non-rust code [guide][2]
+
+[1]: http://doc.rust-lang.org/rust.html#external-blocks
+[2]: native-build.html
+
+```toml
+[package]
+# ...
+build = "make"
+```
+
+```toml
+[package]
+# ...
+
+# Specify two commands to be run sequentially
+build = ["./configure", "make"]
+```
+
+## The `exclude` Field (optional)
+
+You can explicitly specify to Cargo that a set of globs should be ignored for
+the purposes of packaging and rebuilding a package. The globs specified in this
+field identify a set of files that are not included when a package is published
+as well as ignored for the purposes of detecting when to rebuild a package.
+
+If a VCS is being used for a package, the `exclude` field will be seeded with
+the VCS's ignore settings (`.gitignore` for git for example).
+
+```toml
+[package]
+# ...
+exclude = ["build/**/*.o", "doc/**/*.html"]
+```
+
+# The `[dependencies.*]` Sections
+
+You list dependencies using `[dependencies.<name>]`. For example, if you
+wanted to depend on both `hammer` and `color`:
+
+```toml
+[package]
+# ...
+
+[dependencies.hammer]
+version = "0.5.0" # optional
+git = "https://github.com/wycats/hammer.rs"
+
+[dependencies.color]
+git = "https://github.com/bjz/color-rs"
+```
+
+You can specify the source of a dependency in one of two ways at the moment:
+
+* `git = "<git-url>"`: A git repository with a `Cargo.toml` in its root. The
+  `rev`, `tag`, and `branch` options are also recognized to use something other
+  than the `master` branch.
+* `path = "<relative-path>"`: A path relative to the current `Cargo.toml`
+  with a `Cargo.toml` in its root.
+
+Soon, you will be able to load packages from the Cargo registry as well.
+
+# The `[profile.*]` Sections
+
+Cargo supports custom configuration of how rustc is invoked through **profiles**
+at the top level. Any manifest may declare a profile, but only the **top level**
+project's profiles are actually read. All dependencies' profiles will be
+overridden. This is done so the top-level project has control over how its
+dependencies are compiled.
+
+There are five currently supported profile names, all of which have the same
+configuration available to them. Listed below is the configuration available,
+along with the defaults for each profile.
+
+```toml
+# The development profile, used for `cargo build`
+[profile.dev]
+opt-level = 0  # Controls the --opt-level the compiler builds with
+debug = true   # Controls whether the compiler passes -g or `--cfg ndebug`
+
+# The release profile, used for `cargo build --release`
+[profile.release]
+opt-level = 3
+debug = false
+
+# The testing profile, used for `cargo test`
+[profile.test]
+opt-level = 0
+debug = true
+
+# The benchmarking profile, used for `cargo bench`
+[profile.bench]
+opt-level = 3
+debug = false
+
+# The documentation profile, used for `cargo doc`
+[profile.doc]
+opt-level = 0
+debug = true
+```
+
+# The `[dev-dependencies.*]` Sections
+
+The format of this section is equivalent to `[dependencies.*]`. Dev-dependencies
+are not used when compiling a package for building, but are used for compiling
+tests and benchmarks.
+
+These dependencies are *not* propagated to other packages which depend on this
+package.
+
+# The Project Layout
+
+If your project is an executable, name the main source file `src/main.rs`.
+If it is a library, name the main source file `src/lib.rs`.
+
+Cargo will also treat any files located in `src/bin/*.rs` as
+executables.
+
+When you run `cargo build`, Cargo will compile all of these files into
+the `target` directory.
+
+```notrust
+â–¾ src/          # directory containing source files
+  â–¾ bin/        # (optional) directory containing executables
+    *.rs
+  lib.rs        # the main entry point for libraries and packages
+  main.rs       # the main entry point for projects producing executables
+â–¾ examples/     # (optional) examples
+  *.rs
+â–¾ tests/        # (optional) integration tests
+  *.rs
+â–¾ benches/      # (optional) benchmarks
+  *.rs
+```
+
+# Examples
+
+Files located under `examples` are example uses of the functionality
+provided by the library.
+
+They must compile as executables (with `main.rs`) and load in the
+library by using `extern crate <library-name>`. They are compiled when
+you run your tests to protect them from bitrotting.
+
+# Tests
+
+When you run `cargo test`, Cargo will:
+
+* Compile your library's unit tests, which are in files reachable from
+  `lib.rs`. Any sections marked with `#[cfg(test)]` will be included.
+* Compile your library's integration tests, which are located in
+  `tests`. Files in `tests` load in your library by using `extern crate
+  <library-name>` like any other code that depends on it.
+* Compile your library's examples.
+
+# Configuring a target
+
+Both `[[bin]]` and `[lib]` sections support similar configuration for specifying
+how a target should be built. The example below uses `[lib]`, but it also
+applies to all `[[bin]]` sections as well. All values listed ar the defaults for
+that option unless otherwise specified.
+
+```toml
+[package]
+# ...
+
+[lib]
+
+# The name of a target is the name of the library that will be generated. This
+# is defaulted to the name of the package or project.
+name = "foo"
+
+# This field points at where the crate is located, relative to the Cargo.toml.
+path = "src/lib.rs"
+
+# A flag for enabling unit tests for this target. This is used by `cargo test`.
+test = true
+
+# A flag for enabling documentation tests for this target. This is only
+# relevant for libraries, it has no effect on [[bin]] sections. This is used by
+# `cargo test`.
+doctest = true
+
+# A flag for enabling benchmarks for this target. This is used by `cargo bench`.
+bench = true
+
+# A flag for enabling documentation of this target. This is used by `cargo doc`.
+doc = true
+
+# If the target is meant to be a compiler plugin, this field must be set to true
+# for cargo to correctly compile it and make it available for all dependencies.
+plugin = false
+```
+
+# Building Dynamic or Static Libraries
+
+If your project produces a library, you can specify which kind of
+library to build by explicitly listing the library in your `Cargo.toml`:
+
+```toml
+# ...
+
+[lib]
+
+name = "..."
+# this could be "staticlib" as well
+crate-type = ["dylib"]
+```
+
+The available options are `dylib`, `rlib`, and `staticlib`. You should only use
+this option in a project. Cargo will always compile **packages** (dependencies)
+based on the requirements of the project that includes them.
diff --git a/src/doc/native-build.md b/src/doc/native-build.md
new file mode 100644 (file)
index 0000000..6fa5d97
--- /dev/null
@@ -0,0 +1,132 @@
+% Building external code
+
+Some packages need to compile third-party non-Rust code that you will
+link into your Rust code using `#[link]` (more information on `#[link]`
+can be found in [the Rust manual][1]).
+
+Cargo does not aim to replace other tools that are well-optimized for
+building C or C++ code, but it does integrate with them with the `build`
+configuration option.
+
+```toml
+[package]
+
+name = "hello-world-from-c"
+version = "0.0.1"
+authors = [ "you@example.com" ]
+build = "make"
+```
+
+The `build` command will be invoked before `rustc`, allowing your Rust
+code to depend on the built artifacts.
+
+Here's what you need to know:
+
+* Cargo passes your build script an environment variable named
+  `OUT_DIR`, which is where you should put any compiled artifacts. It
+  will be different for different Cargo commands, but Cargo will always
+  pass that output directory as a lib directory to `rustc`.
+* Cargo will retain all output in `OUT_DIR` for clean packages across
+  builds (intelligently discarding the compiled artifacts for dirty
+  dependencies). Do not put the output of a build command in any other
+  directory.
+* The actual location of `$OUT_DIR` is
+  `/path/to/project/target/native/$your-out-dir`.
+* The target triple that the build command should compile for is specified by
+  the `TARGET` environment variable.
+
+What this means is that the normal workflow for build dependencies is:
+
+* The first time a user types `cargo build` for a project that contains
+  your package, your `build` script will be invoked. Place any artifacts
+  into the provided `$OUT_DIR`.
+* The next time a user runs `cargo build`, if the dependency has not
+  changed (via `cargo update <your-package>`), Cargo will reuse the
+  output you provided before. Your build command will not be invoked.
+* If the user updates your package to a new version (or git revision),
+  Cargo will **not** remove the old `$OUT_DIR` will re-invoke your build script.
+  Your build script is responsible for bringing the state of the old directory
+  up to date with the current state of the input files.
+
+In general, build scripts may not be as portable as we'd like today. We
+encourage package authors to write build scripts that can work in both
+Windows and Unix environments.
+
+Several people who work on Cargo are also working on a project called
+[link-config][2], which is a Rust syntax extension whose goal is to
+enable portable external compilation and linkage against system
+packages. We intend for it to eventually serve this purpose for Cargo
+projects.
+
+[1]: http://doc.rust-lang.org/rust.html#linkage
+[2]: https://github.com/alexcrichton/link-config
+
+# Environment Variables
+
+The following environment variables are always available for build
+commands.
+
+* `OUT_DIR` - the folder in which all output should be placed.
+* `TARGET` - the target triple that is being compiled for. Native code should be
+             compiled for this triple.
+* `NUM_JOBS` - the parallelism specified as the top-level parallelism. This can
+               be useful to pass a `-j` parameter to a system like `make`.
+* `DEP_<name>_OUT_DIR` - This variable is present for all immediate dependencies
+                         of the package being built. The `<name>` will be the
+                         package's name, in uppercase, with `-` characters
+                         translated to a `_`. The value of this variable is the
+                         directory in which all the output of the dependency's
+                         build command was placed. This is useful for picking up
+                         things like header files and such from other packages.
+
+# A complete example
+
+The code blocks below lay out a cargo project which has a small and simple C
+dependency along with the necessary infrastructure for linking that to the rust
+program.
+
+```toml
+# Cargo.toml
+[package]
+
+name = "hello-world-from-c"
+version = "0.0.1"
+authors = [ "you@example.com" ]
+build = "make -C build"
+```
+
+```make
+# build/Makefile
+
+# Support cross compilation to/from 32/64 bit.
+ARCH := $(word 1, $(subst -, ,$(TARGET)))
+ifeq ($(ARCH),i686)
+CFLAGS += -m32 -fPIC
+else
+CFLAGS += -m64 -fPIC
+endif
+
+all:
+    $(CC) $(CFLAGS) hello.c -c -o $(OUT_DIR)/hello.o
+    $(AR) crus $(OUT_DIR)/libhello.a $(OUT_DIR)/hello.o
+
+```
+
+```c
+// build/hello.c
+int foo() { return 1; }
+```
+
+```rust
+// src/main.rs
+
+#[link(name = "hello", kind = "static")]
+extern {
+    fn foo() -> i32;
+}
+
+fn main() {
+    let number = unsafe { foo() };
+    println!("found {} from C!", number);
+}
+```
diff --git a/src/doc/source/CNAME b/src/doc/source/CNAME
deleted file mode 100644 (file)
index cbcca7c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-crates.io
diff --git a/src/doc/source/config.md b/src/doc/source/config.md
deleted file mode 100644 (file)
index efc0bef..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
----
-title: Configuration
----
-
-This document will explain how cargo's configuration system works, as well as
-available keys or configuration.  For configuration of a project through its
-manfest, see the [manifest format](manifest.html).
-
-# Hierarchical structure
-
-Cargo allows to have local configuration for a particular project or global
-configuration (like git). Cargo also extends this ability to a hirearchical
-strategy. If, for example, cargo were invoked in `/home/foo/bar/baz`, then the
-following configuration files would be probed for:
-
-* `/home/foo/bar/baz/.cargo/config`
-* `/home/foo/bar/.cargo/config`
-* `/home/foo/.cargo/config`
-* `/home/.cargo/config`
-* `/.cargo/config`
-
-With this structure you can specify local configuration per-project, and even
-possibly check it into version control. You can also specify personal default
-with a configuration file in your home directory.
-
-# Configuration Format
-
-All configuration is currently in the TOML format (like the manifest), with
-simple key-value pairs inside of sections (tables) which all get merged
-together.
-
-# Configuration keys
-
-All of the following keys are optional, and their defaults are listed as their
-value unless otherwise noted.
-
-```toml
-# An array of paths to local repositories which are to be used as overrides for
-# dependencies. For more information see the Cargo Guide.
-paths = [ "/path/to/override" ]
-
-[cargo-new]
-# This is your name/email to place in the `authors` section of a new Cargo.toml
-# that is generated. If not present, then `git` will be probed, and if that is
-# not present then `$USER` will be used (with no email).
-name = "..."
-email = "..."
-
-# By default `cargo new` will initialize a new git repository. This key can be
-# set to `false` to disable this behavior.
-git = true
-
-# For the following sections, $triple refers to any valid target triple, not the
-# literal string "$triple", and it will apply whenever that target triple is
-# being compiled to.
-[target]
-
-# For cargo builds which do not mention --target, these are the ar/linker which
-# are passed to rustc to use (via `-C ar=` and `-C linker=`). By default these
-# flags are not passed to the compiler.
-ar = ".."
-linker = ".."
-
-[target.$triple]
-# Similar to the above ar/linker configuration, but this only applies to when
-# the `$triple` is being compiled for.
-ar = ".."
-linker = ".."
-```
diff --git a/src/doc/source/faq.md b/src/doc/source/faq.md
deleted file mode 100644 (file)
index 2ee3c97..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
----
-title: Frequently Asked Questions
----
-
-# Is the plan to use Github as a package repository? <a href="#github" id="github" class="headerlink">¶</a>
-
-No. The plan for Cargo is to have a central registry of packages, like
-npm or Rubygems.
-
-We plan to support git repositories as a source of packages forever,
-because they can be used for early development and temporary patches,
-even when people use the registry as the primary source of packages.
-
-At the moment, the Rust team is still making regular changes to the
-language, and the Rust project recommends using nightly builds. This
-means that for now, package authors make regular changes in order to
-track the latest Rust. This makes downloading the latest `master` from
-Github the best approach to getting packages at the current point in the
-community's lifecycle.
-
-# Why build a package registry rather than use Github as a registry? <a href="#why-not-github" id="why-not-github" class="headerlink">¶</a>
-
-We think that it's very important to support multiple ways to download
-packages, including downloading from Github and copying packages into
-your project itself.
-
-That said, we think that a central registry offers a number of important
-benefits, and will likely become the primary way that people download
-packages in Cargo.
-
-For precedent, both Node.js's [npm][1] and Ruby's [bundler][2] support both a
-central registry model as well as a Git-based model, and most packages
-are downloaded through the registry in those ecosystems, with an
-important minority of packages making use of git-based packages.
-
-[1]: https://www.npmjs.org
-[2]: https://bundler.io
-
-Some of the advantages that make a central registry popular in other
-languages include:
-
-* **Discoverability**. A central registry provides an easy place to look
-  for existing packages. Combined with tagging, this also makes it
-  possible for a registry to provide ecosystem-wide information, such as a
-  list of the most popular or most-depended-on packages.
-* **Speed**. A central registry makes it possible to easily fetch just
-  the metadata for packages quickly and efficiently, and then to
-  efficiently download just the published package, and not other bloat
-  that happens to exist in the repository. This adds up to a significant
-  improvement in the speed of dependency resolution and fetching. As
-  dependency graphs scale up, downloading all of the git repositories bogs
-  down fast. Also remember that not everybody has a high-speed,
-  low-latency Internet connection.
-
-# Will Cargo work with C code (or other languages)? <a href="#c" id="c" class="headerlink">¶</a>
-
-Yes!
-
-Cargo handles compiling Rust code, but we know that many Rust projects
-link against C code. We also know that there are decades of tooling
-built up around compiling languages other than Rust.
-
-Our solution: Cargo allows a package to specify a script to run
-before invoking `rustc`. We plan to add support for platform-specific
-configuration, so you can use `make` on Linux and `cmake` on BSD, for
-example.
-
-# Can Cargo be used inside of `make` (or `ninja`, or ...) <a href="#make" id="make" class="headerlink">¶</a>
-
-Indeed. While we intend Cargo to be useful as a standalone way to
-compile Rust projects at the top-level, we know that some people will
-want to invoke Cargo from other build tools.
-
-We have designed Cargo to work well in those contexts, paying attention
-to things like error codes and machine-readable output modes. We still
-have some work to do on those fronts, but using Cargo in the context of
-conventional scripts is something we designed for from the beginning and
-will continue to prioritize.
-
-# Does Cargo handle multi-platform projects or cross-compilation? <a href="#multi-platform" id="multi-platform" class="headerlink">¶</a>
-
-Rust itself provides facilities for configuring sections of code based
-on the platform. We plan to support per-platform configuration in
-`Cargo.toml`, including platform-specific dependencies, in the near
-future.
-
-In the longer-term, we're looking at ways to conveniently cross-compile
-projects using Cargo.
-
-# Does Cargo support environments, like `production` or `test`? <a href="#environments" id="environments" class="headerlink">¶</a>
-
-We are planning on support environments in the near future, that can
-support:
-
-* environment-specific flags (like `-g --opt-level=0` for development
-  and `--opt-level=3` for production).
-* environment-specific dependencies (like `hamcrest` for test assertions).
-* environment-specific `#[cfg]`
-* a `cargo test` command
-
-We also plan to make it possible to specify "profiles", which can
-specify flags or dependencies for a combination of multiple environments
-and platforms ("use `fsevents`, but only in OSX in `development` or
-`test`").
-
-# Does Cargo work on Windows? <a href="#windows" id="windows" class="headerlink">¶</a>
-
-Yes!
-
-All commits to Cargo are required to pass the local test suite on Windows.
-If, however, you find a Windows issue, we consider it a bug, so [please file an
-issue][3].
-
-[3]: https://github.com/rust-lang/cargo/issues
-
-# Why do binaries have `Cargo.lock` in version control, but not libraries?
-
-The purpose of a `Cargo.lock` is to describe the state of the world at the time
-of a successful build. It is then used to provide deterministic builds across
-whatever machine is building the project by ensuring that the exact same
-dependencies are being compiled.
-
-This property is most desirable from applications and projects which are at the
-very end of the dependency chain (binaries). As a result, it is recommended that
-all binaries check in their `Cargo.lock`.
-
-For libraries the situation is somewhat different. A library is not only used by
-the library developers, but also any downstream consumers of the library. Users
-dependent on the library will not inspect the library's `Cargo.lock` (even if it
-exists). This is precisely because a library should **not** be deterministically
-recompiled for all users of the library.
-
-If a library ends up being used transitively by several dependencies, it's
-likely that just a single copy of the library is desired (based on semver
-compatibility). If all libraries were to check in their `Cargo.lock`, then
-multiple copies of the library would be used, and perhaps even a version
-conflict.
-
-In other words, libraries specify semver requirements for their dependencies but
-cannot see the full picture. Only end products like binaries have a full
-picture to decide what versions of dependencies should be used.
diff --git a/src/doc/source/guide.md b/src/doc/source/guide.md
deleted file mode 100644 (file)
index c826d01..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
----
-title: Guide
----
-
-Welcome to the Cargo guide. This guide will give you all that you need to know
-about how to use Cargo to develop Rust projects.
-
-# Why Cargo exists
-
-Cargo is a tool that allows Rust projects to declare their various
-dependencies, and ensure that you'll always get a repeatable build.
-
-To accomplish this goal, Cargo does four things:
-
-* Introduces two metadata files with various bits of project information.
-* Fetches and builds your project's dependencies.
-* Invokes `rustc` or another build tool with the correct parameters to build your project.
-* Introduces conventions, making working with Rust projects easier.
-
-# Converting to Cargo
-
-You can convert an existing Rust project to use Cargo. You'll have to create a
-`Cargo.toml` file with all of your dependencies, and move your source files and
-test files into the places where Cargo expects them to be. See the [manifest
-description](/manifest.html) and the "Cargo Conventions" section below for more
-details.
-
-# Creating A New Project
-
-To start a new project with Cargo, use `cargo new`:
-
-```shell
-$ cargo new hello_world --bin
-```
-
-We're passing `--bin` because we're making a binary program: if we
-were making a library, we'd leave it off. If you'd like to not initialize a new
-git repository as well (the default), you can also pass `--no-git`.
-
-Let's check out what Cargo has generated for us:
-
-```shell
-$ cd hello_world
-$ tree .
-.
-├── Cargo.toml
-└── src
-    â””── main.rs
-
-1 directory, 2 files
-```
-
-This is all we need to get started. First, let's check out `Cargo.toml`:
-
-```toml
-[package]
-
-name = "hello_world"
-version = "0.0.1"
-authors = ["Your Name <you@example.com>"]
-```
-
-This is called a **manifest**, and it contains all of the metadata that Cargo
-needs to compile your project.
-
-Here's what's in `src/main.rs`:
-
-```rs
-fn main() {
-    println!("Hello, world!")
-}
-```
-
-Cargo generated a 'hello world' for us. Let's compile it:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo build
-<span style="font-weight: bold"
-class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)</code></pre>
-
-And then run it:
-
-```shell
-$ ./target/hello_world
-Hello, world!
-```
-
-We can also use `cargo run` to compile and then run it, all in one step:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo run
-<span style="font-weight: bold"
-class="s1">     Fresh</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
-<span style="font-weight: bold"
-class="s1">   Running</span> `target/hello_world`
-Hello, world!</code></pre>
-
-You'll now notice a new file, `Cargo.lock`. It contains information about our
-dependencies. Since we don't have any yet, it's not very interesting.
-
-# Working on an existing Cargo project
-
-If you download an existing project that uses Cargo, it's really easy
-to get going.
-
-First, get the project from somewhere. In this example, we'll use `color-rs`:
-
-```sh
-$ git clone https://github.com/bjz/color-rs.git
-$ cd color-rs
-```
-
-To build, just use `cargo build`:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo build
-<span style="font-weight: bold" class="s1">   Compiling</span> color v0.0.1 (file:///path/to/project/color-rs)</code></pre>
-
-This will fetch all of the dependencies and then build them, along with the
-project.
-
-# Adding Dependencies
-
-To depend on a library, add it to your `Cargo.toml`.
-
-```toml
-[package]
-
-name = "hello_world"
-version = "0.0.1"
-authors = ["Your Name <you@example.com>"]
-
-[dependencies.color]
-
-git = "https://github.com/bjz/color-rs.git"
-```
-
-You added the `color` library, which provides simple conversions
-between different color types.
-
-Now, you can pull in that library using `extern crate` in
-`main.rs`.
-
-```rs
-extern crate color;
-
-use color::{Rgb, ToHsv};
-
-fn main() {
-    println!("Converting RGB to HSV!");
-    let red = Rgb::new(255u8, 0, 0);
-    println!("HSV: {}", red.to_hsv::<f32>());
-}
-```
-
-Let's tell Cargo to fetch this new dependency and update the `Cargo.lock`:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo update color
-<span style="font-weight: bold" class="s1">    Updating</span> git repository `https://github.com/bjz/color-rs.git`</code></pre>
-
-Compile it:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo run
-<span style="font-weight: bold" class="s1">   Compiling</span> color v0.0.1 (https://github.com/bjz/color-rs.git#bf739419)
-<span style="font-weight: bold" class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
-<span style="font-weight: bold" class="s1">     Running</span> `target/hello_world`
-Converting RGB to HSV!
-HSV: HSV { h: 0, s: 1, v: 1 }</code></pre>
-
-We just specified a `git` repository for our dependency, but our `Cargo.lock`
-contains the exact information about which revision we used:
-
-```toml
-[root]
-name = "hello_world"
-version = "0.0.1"
-dependencies = [
- "color 0.0.1 (git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98)",
-]
-
-[[package]]
-name = "color"
-version = "0.0.1"
-source = "git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98"
-
-```
-
-Now, if `color-rs` gets updated, we will still build with the same revision, until
-we choose to `cargo update` again.
-
-# Cargo Conventions
-
-Cargo uses conventions to make it easy to dive into a new Cargo project. Here
-are the conventions that Cargo uses:
-
-* `Cargo.toml` and `Cargo.lock` are stored in the root of your project.
-* Source code goes in the `src` directory.
-* External tests go in the `tests` directory.
-* The default executable file is `src/main.rs`.
-* Other executables can be placed in `src/bin/*.rs`.
-* The default library file is `src/lib.rs`.
-
-# Cargo.toml vs Cargo.lock
-
-`Cargo.toml` and `Cargo.lock` serve two different purposes. Before we talk
-about them, here's a summary:
-
-* `Cargo.toml` is about describing your dependencies in a broad sense, and is written by you.
-* `Cargo.lock` contains exact information about your dependencies, and is maintained by Cargo.
-* If you're building a library, put `Cargo.lock` in your `.gitignore`.
-* If you're building an executable, check `Cargo.lock` into `git`.
-
-Let's dig in a little bit more.
-
-`Cargo.toml` is a **manifest** file. In the manifest, we can specify a bunch of
-different metadata about our project. For example, we can say that we depend
-on another project:
-
-```toml
-[package]
-
-name = "hello_world"
-version = "0.0.1"
-authors = ["Your Name <you@example.com>"]
-
-[dependencies.color]
-
-git = "https://github.com/bjz/color-rs.git"
-```
-
-This project has a single dependency, on the `color` library. We've stated in
-this case that we're relying on a particular Git repository that lives on
-GitHub. Since we haven't specified any other information, Cargo assumes that
-we intend to use the latest commit on the `master` branch to build our project.
-
-Sound good? Well, there's one problem: If you build this project today, and
-then you send a copy to me, and I build this project tomorrow, something bad
-could happen. `bjz` could update `color-rs` in the meantime, and my build would
-include this commit, while yours would not. Therefore, we would get different
-builds. This would be bad, because we want reproducible builds.
-
-We could fix this problem by putting a `rev` line in our `Cargo.toml`:
-
-```toml
-[dependencies.color]
-
-git = "https://github.com/bjz/color-rs.git"
-rev = "bf739419e2d31050615c1ba1a395b474269a4"
-```
-
-Now, our builds will be the same. But, there's a big drawback: now we have to
-manually think about SHA-1s every time we want to update our library. This is
-both tedius and error prone.
-
-Enter the `Cargo.lock`. Because of its existence, we don't need to manually
-keep track of the exact revisions: Cargo will do it for us. When we have a
-manifest like this:
-
-```toml
-[package]
-
-name = "hello_world"
-version = "0.0.1"
-authors = ["Your Name <you@example.com>"]
-
-[dependencies.color]
-
-git = "https://github.com/bjz/color-rs.git"
-```
-
-Cargo will take the latest commit, and write that information out into our
-`Cargo.lock` when we build for the first time. That file will look like this:
-
-```toml
-[root]
-name = "hello_world"
-version = "0.0.1"
-dependencies = [
- "color 0.0.1 (git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98)",
-]
-
-[[package]]
-name = "color"
-version = "0.0.1"
-source = "git+https://github.com/bjz/color-rs.git#bf739419e2d31050615c1ba1a395b474269a4b98"
-
-```
-
-You can see that there's a lot more information here, including the exact
-revision we used to build. Now, when you give your project to someone else,
-they'll use the exact same SHA, even though we didn't specify it in our
-`Cargo.toml`.
-
-When we're ready to opt in to a new version of the library, Cargo can
-re-calculate the dependencies, and update things for us:
-
-```shell
-$ cargo update       # updates all dependencies
-$ cargo update color # updates just 'color'
-```
-
-This will write out a new `Cargo.lock` with the new version information.
-
-# Overriding Dependencies
-
-Sometimes, you may want to override one of Cargo's dependencies. For example,
-let's say you're working on a project, `conduit-static`, which depends on
-the package `conduit`. You find a bug in `conduit`, and you want to write a
-patch. Here's what `conduit-static`'s `Cargo.toml` looks like:
-
-```toml
-[package]
-
-name = "conduit-static"
-version = "0.0.1"
-authors = ["Yehuda Katz <wycats@example.com>"]
-
-[dependencies.conduit]
-
-git = "https://github.com/conduit-rust/conduit.git"
-```
-
-You check out a local copy of `conduit`, let's say in your `~/src` directory:
-
-```shell
-$ cd ~/src
-$ git clone https://github.com/conduit-rust/conduit.git
-```
-
-You'd like to have `conduit-static` use your local version of `conduit`,
-rather than the one on GitHub, while you fix the bug.
-
-Cargo solves this problem by allowing you to have a local configuration
-that specifies an **override**. If Cargo finds this configuration when
-building your package, it will use the override on your local machine
-instead of the source specified in your `Cargo.toml`.
-
-Cargo looks for a directory named `.cargo` up the directory hierarchy of
-your project. If your project is in `/path/to/project/conduit-static`,
-it will search for a `.cargo` in:
-
-* `/path/to/project/conduit-static`
-* `/path/to/project`
-* `/path/to`
-* `/path`
-* `/`
-
-This allows you to specify your overrides in a parent directory that
-includes commonly used packages that you work on locally, and share them
-with all projects.
-
-To specify overrides, create a `.cargo/config` file in some ancestor of
-your project's directory (common places to put it is in the root of
-your code directory or in your home directory).
-
-Inside that file, put this:
-
-```
-paths = ["/path/to/project/conduit"]
-```
-
-This array should be filled with directories that contain a `Cargo.toml`. In
-this instance, we're just adding `conduit`, so it will be the only one that's
-overridden.
-
-More information about local configuration can be found in the [configuration
-documentation](config.html).
-
-# Tests
-
-Cargo can run your tests with the `cargo test` command. Cargo runs tests in two
-places: in each of your `src` files, and any tests in `tests/`. Tests
-in your `src` files should be unit tests, and tests in `tests/` should be
-integration-style tests. As such, you'll need to import your crates into
-the files in `tests`.
-
-To run your tests, just run `cargo test`:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo test
-<span style="font-weight: bold"
-class="s1">   Compiling</span> color v0.0.1 (https://github.com/bjz/color-rs.git#bf739419)
-<span style="font-weight: bold"
-class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
-<span style="font-weight: bold"
-class="s1">     Running</span> target/test/hello_world-9c2b65bbb79eabce
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
-</code></pre>
-
-Of course, if your project has tests, you'll see more output, with the
-correct number of tests.
-
-## Travis-CI
-
-To test your project on Travis-CI, here is a sample `.travis.yml` file:
-
-```
-language: rust
-script:
-  - cargo build --verbose
-  - cargo test --verbose
-```
diff --git a/src/doc/source/images/Cargo-Logo-Small.png b/src/doc/source/images/Cargo-Logo-Small.png
deleted file mode 100644 (file)
index eca9665..0000000
Binary files a/src/doc/source/images/Cargo-Logo-Small.png and /dev/null differ
diff --git a/src/doc/source/images/forkme.png b/src/doc/source/images/forkme.png
deleted file mode 100644 (file)
index 100aad0..0000000
Binary files a/src/doc/source/images/forkme.png and /dev/null differ
diff --git a/src/doc/source/images/noise.png b/src/doc/source/images/noise.png
deleted file mode 100644 (file)
index 545d930..0000000
Binary files a/src/doc/source/images/noise.png and /dev/null differ
diff --git a/src/doc/source/index.md b/src/doc/source/index.md
deleted file mode 100644 (file)
index ecc77d5..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
----
-title: Cargo, Rust's Package Manager
----
-
-# Installing
-
-The easiest way to get Cargo is to get the Rust nightly build by using
-the `rustup` script:
-
-```shell
-$ curl https://static.rust-lang.org/rustup.sh | sudo bash
-```
-
-This will get you the latest Rust nightly for your platform along with
-the latest Cargo. You should run this script almost every day to get the latest updates.
-
-If you are on Windows, you can directly download the latest [Rust](http://static.rust-lang.org/dist/rust-nightly-install.exe)
-and [Cargo](http://static.rust-lang.org/cargo-dist/cargo-nightly-i686-pc-mingw32.tar.gz) nightlies.
-
-Alternatively, you can build Cargo from source.
-
-# Let's Get Started
-
-To start a new project with Cargo, use `cargo new`:
-
-```shell
-$ cargo new hello_world --bin
-```
-
-We're passing `--bin` because we're making a binary program: if we
-were making a library, we'd leave it off.
-
-Let's check out what Cargo has generated for us:
-
-```shell
-$ cd hello_world
-$ tree .
-.
-├── Cargo.toml
-└── src
-    â””── main.rs
-
-1 directory, 2 files
-```
-
-This is all we need to get started. First, let's check out `Cargo.toml`:
-
-```toml
-[package]
-
-name = "hello_world"
-version = "0.0.1"
-authors = ["Your Name <you@example.com>"]
-```
-
-This is called a **manifest**, and it contains all of the metadata that Cargo
-needs to compile your project.
-
-Here's what's in `src/main.rs`:
-
-```rs
-fn main() {
-    println!("Hello, world!")
-}
-```
-
-Cargo generated a 'hello world' for us. Let's compile it:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo build
-<span style="font-weight: bold"
-class="s1">   Compiling</span> hello_world v0.0.1 (file:///path/to/project/hello_world)</code></pre>
-
-And then run it:
-
-```shell
-$ ./target/hello_world
-Hello, world!
-```
-
-We can also use `cargo run` to compile and then run it, all in one step:
-
-<pre><code class="highlight"><span class="gp">$</span> cargo run
-<span style="font-weight: bold"
-class="s1">     Fresh</span> hello_world v0.0.1 (file:///path/to/project/hello_world)
-<span style="font-weight: bold"
-class="s1">   Running</span> `target/hello_world`
-Hello, world!</code></pre>
-
-# Going Further
-
-For more details on using Cargo, check out the [Cargo Guide](/guide.html)
diff --git a/src/doc/source/javascripts/all.js b/src/doc/source/javascripts/all.js
deleted file mode 100644 (file)
index 2becd76..0000000
+++ /dev/null
@@ -1 +0,0 @@
-//= require_tree .
\ No newline at end of file
diff --git a/src/doc/source/layouts/layout.erb b/src/doc/source/layouts/layout.erb
deleted file mode 100644 (file)
index e155547..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-
-    <!-- Always force latest IE rendering engine or request Chrome Frame -->
-    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
-
-    <!-- Use title if it's in the page YAML frontmatter -->
-    <title><%= current_page.data.title || "The Middleman" %></title>
-
-    <%= stylesheet_link_tag "all" %>
-    <%= javascript_include_tag  "all" %>
-  </head>
-
-  <body class="<%= page_classes %>">
-    <%= link_to image_tag("forkme.png", class: "fork-me"), "https://github.com/rust-lang/cargo" %>
-    <%= link_to image_tag("Cargo-Logo-Small.png", class: "logo"), "index.html" %>
-
-    <main>
-      <p>Cargo downloads your <a href="http://rust-lang.org">Rust</a> project's dependencies and builds your project</p>
-
-      <%= yield %>
-
-      <footer>
-        <%= link_to "Guide", "guide.html" %> |
-        <%= link_to "Frequently Asked Questions", "faq.html" %> |
-        <%= link_to "Manifest Format", "manifest.html" %> |
-        <%= link_to "Building Non-Rust Code", "native-build.html" %> |
-        <%= link_to "Configuration", "config.html" %>
-      </footer>
-    </main>
-
-  </body>
-</html>
diff --git a/src/doc/source/manifest.md b/src/doc/source/manifest.md
deleted file mode 100644 (file)
index 0480aea..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
----
-title: The Manifest Format
----
-
-# The `[package]` Section
-
-The first section in a `Cargo.toml` is `[package]`.
-
-```toml
-[package]
-name = "hello_world" # the name of the package
-version = "0.0.1"    # the current version, obeying semver
-authors = [ "you@example.com" ]
-```
-
-All three of these fields are mandatory. Cargo bakes in the concept of
-[Semantic Versioning](http://semver.org/), so make sure you follow some
-basic rules:
-
-* Before you reach 1.0.0, anything goes.
-* After 1.0.0, only make breaking changes when you increment the major
-  version. In Rust, breaking changes include adding fields to structs or
-  variants to enums. Don't break the build.
-* After 1.0.0, don't add any new public API (no new `pub` anything) in
-  tiny versions. Always increment the minor version if you add any new
-  `pub` structs, traits, fields, types, functions, methods or anything else.
-* Use version numbers with three numeric parts such as 1.0.0 rather than 1.0.
-
-## The `build` Field (optional)
-
-You can specify a script that Cargo should execute before invoking
-`rustc`. You can use this to compile C code that you will [link][1] into
-your Rust code, for example. More information can be found in the building
-non-rust code [guide][2]
-
-[1]: http://doc.rust-lang.org/rust.html#external-blocks
-[2]: native-build.html
-
-```toml
-[package]
-# ...
-build = "make"
-```
-
-```toml
-[package]
-# ...
-
-# Specify two commands to be run sequentially
-build = ["./configure", "make"]
-```
-
-## The `exclude` Field (optional)
-
-You can explicitly specify to Cargo that a set of globs should be ignored for
-the purposes of packaging and rebuilding a package. The globs specified in this
-field identify a set of files that are not included when a package is published
-as well as ignored for the purposes of detecting when to rebuild a package.
-
-If a VCS is being used for a package, the `exclude` field will be seeded with
-the VCS's ignore settings (`.gitignore` for git for example).
-
-```toml
-[package]
-# ...
-exclude = ["build/**/*.o", "doc/**/*.html"]
-```
-
-# The `[dependencies.*]` Sections
-
-You list dependencies using `[dependencies.<name>]`. For example, if you
-wanted to depend on both `hammer` and `color`:
-
-```toml
-[package]
-# ...
-
-[dependencies.hammer]
-version = "0.5.0" # optional
-git = "https://github.com/wycats/hammer.rs"
-
-[dependencies.color]
-git = "https://github.com/bjz/color-rs"
-```
-
-You can specify the source of a dependency in one of two ways at the moment:
-
-* `git = "<git-url>"`: A git repository with a `Cargo.toml` in its root. The
-  `rev`, `tag`, and `branch` options are also recognized to use something other
-  than the `master` branch.
-* `path = "<relative-path>"`: A path relative to the current `Cargo.toml`
-  with a `Cargo.toml` in its root.
-
-Soon, you will be able to load packages from the Cargo registry as well.
-
-# The `[profile.*]` Sections
-
-Cargo supports custom configuration of how rustc is invoked through **profiles**
-at the top level. Any manifest may declare a profile, but only the **top level**
-project's profiles are actually read. All dependencies' profiles will be
-overridden. This is done so the top-level project has control over how its
-dependencies are compiled.
-
-There are five currently supported profile names, all of which have the same
-configuration available to them. Listed below is the configuration available,
-along with the defaults for each profile.
-
-```toml
-# The development profile, used for `cargo build`
-[profile.dev]
-opt-level = 0  # Controls the --opt-level the compiler builds with
-debug = true   # Controls whether the compiler passes -g or `--cfg ndebug`
-
-# The release profile, used for `cargo build --release`
-[profile.release]
-opt-level = 3
-debug = false
-
-# The testing profile, used for `cargo test`
-[profile.test]
-opt-level = 0
-debug = true
-
-# The benchmarking profile, used for `cargo bench`
-[profile.bench]
-opt-level = 3
-debug = false
-
-# The documentation profile, used for `cargo doc`
-[profile.doc]
-opt-level = 0
-debug = true
-```
-
-# The `[dev-dependencies.*]` Sections
-
-The format of this section is equivalent to `[dependencies.*]`. Dev-dependencies
-are not used when compiling a package for building, but are used for compiling
-tests and benchmarks.
-
-These dependencies are *not* propagated to other packages which depend on this
-package.
-
-# The Project Layout
-
-If your project is an executable, name the main source file `src/main.rs`.
-If it is a library, name the main source file `src/lib.rs`.
-
-Cargo will also treat any files located in `src/bin/*.rs` as
-executables.
-
-When you run `cargo build`, Cargo will compile all of these files into
-the `target` directory.
-
-```
-â–¾ src/          # directory containing source files
-  â–¾ bin/        # (optional) directory containing executables
-    *.rs
-  lib.rs        # the main entry point for libraries and packages
-  main.rs       # the main entry point for projects producing executables
-â–¾ examples/     # (optional) examples
-  *.rs
-â–¾ tests/        # (optional) integration tests
-  *.rs
-â–¾ benches/      # (optional) benchmarks
-  *.rs
-```
-
-# Examples
-
-Files located under `examples` are example uses of the functionality
-provided by the library.
-
-They must compile as executables (with `main.rs`) and load in the
-library by using `extern crate <library-name>`. They are compiled when
-you run your tests to protect them from bitrotting.
-
-# Tests
-
-When you run `cargo test`, Cargo will:
-
-* Compile your library's unit tests, which are in files reachable from
-  `lib.rs`. Any sections marked with `#[cfg(test)]` will be included.
-* Compile your library's integration tests, which are located in
-  `tests`. Files in `tests` load in your library by using `extern crate
-  <library-name>` like any other code that depends on it.
-* Compile your library's examples.
-
-# Configuring a target
-
-Both `[[bin]]` and `[lib]` sections support similar configuration for specifying
-how a target should be built. The example below uses `[lib]`, but it also
-applies to all `[[bin]]` sections as well. All values listed ar the defaults for
-that option unless otherwise specified.
-
-```toml
-[package]
-# ...
-
-[lib]
-
-# The name of a target is the name of the library that will be generated. This
-# is defaulted to the name of the package or project.
-name = "foo"
-
-# This field points at where the crate is located, relative to the Cargo.toml.
-path = "src/lib.rs"
-
-# A flag for enabling unit tests for this target. This is used by `cargo test`.
-test = true
-
-# A flag for enabling documentation tests for this target. This is only
-# relevant for libraries, it has no effect on [[bin]] sections. This is used by
-# `cargo test`.
-doctest = true
-
-# A flag for enabling benchmarks for this target. This is used by `cargo bench`.
-bench = true
-
-# A flag for enabling documentation of this target. This is used by `cargo doc`.
-doc = true
-
-# If the target is meant to be a compiler plugin, this field must be set to true
-# for cargo to correctly compile it and make it available for all dependencies.
-plugin = false
-```
-
-# Building Dynamic or Static Libraries
-
-If your project produces a library, you can specify which kind of
-library to build by explicitly listing the library in your `Cargo.toml`:
-
-```toml
-# ...
-
-[lib]
-
-name = "..."
-# this could be "staticlib" as well
-crate-type = ["dylib"]
-```
-
-The available options are `dylib`, `rlib`, and `staticlib`. You should only use
-this option in a project. Cargo will always compile **packages** (dependencies)
-based on the requirements of the project that includes them.
diff --git a/src/doc/source/native-build.md b/src/doc/source/native-build.md
deleted file mode 100644 (file)
index bc253fa..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
----
-title: Building external code
----
-
-Some packages need to compile third-party non-Rust code that you will
-link into your Rust code using `#[link]` (more information on `#[link]`
-can be found in [the Rust manual][1]).
-
-Cargo does not aim to replace other tools that are well-optimized for
-building C or C++ code, but it does integrate with them with the `build`
-configuration option.
-
-```toml
-[package]
-
-name = "hello-world-from-c"
-version = "0.0.1"
-authors = [ "you@example.com" ]
-build = "make"
-```
-
-The `build` command will be invoked before `rustc`, allowing your Rust
-code to depend on the built artifacts.
-
-Here's what you need to know:
-
-* Cargo passes your build script an environment variable named
-  `OUT_DIR`, which is where you should put any compiled artifacts. It
-  will be different for different Cargo commands, but Cargo will always
-  pass that output directory as a lib directory to `rustc`.
-* Cargo will retain all output in `OUT_DIR` for clean packages across
-  builds (intelligently discarding the compiled artifacts for dirty
-  dependencies). Do not put the output of a build command in any other
-  directory.
-* The actual location of `$OUT_DIR` is
-  `/path/to/project/target/native/$your-out-dir`.
-* The target triple that the build command should compile for is specified by
-  the `TARGET` environment variable.
-
-What this means is that the normal workflow for build dependencies is:
-
-* The first time a user types `cargo build` for a project that contains
-  your package, your `build` script will be invoked. Place any artifacts
-  into the provided `$OUT_DIR`.
-* The next time a user runs `cargo build`, if the dependency has not
-  changed (via `cargo update <your-package>`), Cargo will reuse the
-  output you provided before. Your build command will not be invoked.
-* If the user updates your package to a new version (or git revision),
-  Cargo will **not** remove the old `$OUT_DIR` will re-invoke your build script.
-  Your build script is responsible for bringing the state of the old directory
-  up to date with the current state of the input files.
-
-In general, build scripts may not be as portable as we'd like today. We
-encourage package authors to write build scripts that can work in both
-Windows and Unix environments.
-
-Several people who work on Cargo are also working on a project called
-[link-config][2], which is a Rust syntax extension whose goal is to
-enable portable external compilation and linkage against system
-packages. We intend for it to eventually serve this purpose for Cargo
-projects.
-
-[1]: http://doc.rust-lang.org/rust.html#linkage
-[2]: https://github.com/alexcrichton/link-config
-
-# Environment Variables
-
-The following environment variables are always available for build
-commands.
-
-* `OUT_DIR` - the folder in which all output should be placed.
-* `TARGET` - the target triple that is being compiled for. Native code should be
-             compiled for this triple.
-* `NUM_JOBS` - the parallelism specified as the top-level parallelism. This can
-               be useful to pass a `-j` parameter to a system like `make`.
-* `DEP_<name>_OUT_DIR` - This variable is present for all immediate dependencies
-                         of the package being built. The `<name>` will be the
-                         package's name, in uppercase, with `-` characters
-                         translated to a `_`. The value of this variable is the
-                         directory in which all the output of the dependency's
-                         build command was placed. This is useful for picking up
-                         things like header files and such from other packages.
-
-# A complete example
-
-The code blocks below lay out a cargo project which has a small and simple C
-dependency along with the necessary infrastructure for linking that to the rust
-program.
-
-```toml
-# Cargo.toml
-[package]
-
-name = "hello-world-from-c"
-version = "0.0.1"
-authors = [ "you@example.com" ]
-build = "make -C build"
-```
-
-```make
-# build/Makefile
-
-# Support cross compilation to/from 32/64 bit.
-ARCH := $(word 1, $(subst -, ,$(TARGET)))
-ifeq ($(ARCH),i686)
-CFLAGS += -m32 -fPIC
-else
-CFLAGS += -m64 -fPIC
-endif
-
-all:
-    $(CC) $(CFLAGS) hello.c -c -o $(OUT_DIR)/hello.o
-    $(AR) crus $(OUT_DIR)/libhello.a $(OUT_DIR)/hello.o
-
-```
-
-```c
-// build/hello.c
-int foo() { return 1; }
-```
-
-```rust
-// src/main.rs
-
-#[link(name = "hello", kind = "static")]
-extern {
-    fn foo() -> i32;
-}
-
-fn main() {
-    let number = unsafe { foo() };
-    println!("found {} from C!", number);
-}
-```
diff --git a/src/doc/source/stylesheets/all.css.scss b/src/doc/source/stylesheets/all.css.scss
deleted file mode 100644 (file)
index 6e8b9fd..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-@charset "utf-8";
-@import "compass/reset";
-@import "compass/css3/images";
-@import "fonts";
-@import "solarized";
-@import "colors";
-
-html {
-  @include background(image-url("noise.png"), radial-gradient(top
-  center, circle, $light-green 0%, $dark-green 750px));
-}
-
-pre {
-  font-family: monospace;
-  font-size: 110%;
-}
-
-body {
-  font-family: sans-serif;
-}
-
-* {
-  box-sizing: border-box;
-}
-
-body {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-
-a {
-  color: $orange;
-
-  &:hover {
-    color: $purple;
-  }
-}
-
-h1 {
-  font-size: 24px;
-  margin: 20px 0 10px 0;
-  font-weight: bold;
-  color: $purple;
-
-  code:not(.highlight) {
-    color: darken($orange, 5%);
-    vertical-align: bottom;
-  }
-
-  &:hover {
-    .headerlink {
-      display: inline-block;
-    }
-  }
-}
-
-h1:first-child {
-  margin-top: 0;
-}
-
-h2 {
-  font-size: 18px;
-  margin: 15px 0 5px 0;
-  color: $purple;
-  font-weight: bold;
-
-  code:not(.highlight) {
-    color: darken($orange, 5%);
-  }
-}
-
-code:not(.highlight) {
-  font-family: monospace;
-  font-size: 110%;
-  color: $purple;
-}
-
-main {
-  display: flex;
-  flex-direction: column;
-
-  max-width: 900px;
-  margin-bottom: 10px;
-
-  background-color: $cream;
-  padding: 15px;
-  border-radius: 5px;
-  box-shadow: 0px 0px 5px 2px $dark-green;
-
-  p:first-child {
-    color: $light-green;
-    font-weight: 500;
-    margin-top: 3px;
-    padding-bottom: 15px;
-    border-bottom: 1px solid $second-green;
-    text-align: center;
-
-    a {
-      color: $dark-green;
-
-      &:hover {
-        color: $second-green;
-      }
-    }
-  }
-
-  p, ul {
-    color: $dark-green;
-    margin: 10px 0;
-    line-height: 150%;
-  }
-
-  ul {
-    margin-left: 20px;
-  }
-
-  li {
-    list-style-type: disc;
-  }
-
-  strong {
-    font-weight: bold;
-  }
-}
-
-img.logo {
-  align-self: center;
-  margin-bottom: 10px;
-}
-
-pre {
-  background: $beige;
-  padding: 10px;
-  margin: 10px 0;
-  border: 1px solid lighten(#93a1a1, 20%);
-  border-radius: 4px;
-  line-height: 120%;
-  max-width: calc(100vw - 45px);
-  overflow-x: auto;
-}
-
-footer {
-  margin-top: 10px;
-  border-top: 1px solid $purple;
-  padding-top: 10px;
-  width: 100%;
-  text-align: center;
-
-  a {
-    color: $purple;
-    text-decoration: none;
-
-    &:hover {
-      text-decoration: underline;
-    }
-  }
-}
-
-.headerlink {
-  display: none;
-  text-decoration: none;
-}
-
-.fork-me {
-  position:absolute;
-  top:0;
-  right:0;
-}
diff --git a/src/doc/source/stylesheets/colors.css.scss b/src/doc/source/stylesheets/colors.css.scss
deleted file mode 100644 (file)
index 08a8e12..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// primary
-$dark-green: #3B6837;
-$light-green: #199B5C;
-$purple: #B64790;
-$orange: #F3BB00;
-
-// secondary
-$second-green: #62865F;
-$beige: #EEECDD;
-$cream: #F9F7EC;
-$dark-cream: #FFF2C8;
-
diff --git a/src/doc/source/stylesheets/fonts.css.scss b/src/doc/source/stylesheets/fonts.css.scss
deleted file mode 100644 (file)
index 09709a4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@import "compass/css3";
diff --git a/src/doc/source/stylesheets/normalize.css b/src/doc/source/stylesheets/normalize.css
deleted file mode 100644 (file)
index 73abb76..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
-
-/* ==========================================================================
-   HTML5 display definitions
-   ========================================================================== */
-
-/*
- * Corrects `block` display not defined in IE 8/9.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-nav,
-section,
-summary {
-    display: block;
-}
-
-/*
- * Corrects `inline-block` display not defined in IE 8/9.
- */
-
-audio,
-canvas,
-video {
-    display: inline-block;
-}
-
-/*
- * Prevents modern browsers from displaying `audio` without controls.
- * Remove excess height in iOS 5 devices.
- */
-
-audio:not([controls]) {
-    display: none;
-    height: 0;
-}
-
-/*
- * Addresses styling for `hidden` attribute not present in IE 8/9.
- */
-
-[hidden] {
-    display: none;
-}
-
-/* ==========================================================================
-   Base
-   ========================================================================== */
-
-/*
- * 1. Sets default font family to sans-serif.
- * 2. Prevents iOS text size adjust after orientation change, without disabling
- *    user zoom.
- */
-
-html {
-    font-family: sans-serif; /* 1 */
-    -webkit-text-size-adjust: 100%; /* 2 */
-    -ms-text-size-adjust: 100%; /* 2 */
-}
-
-/*
- * Removes default margin.
- */
-
-body {
-    margin: 0;
-}
-
-/* ==========================================================================
-   Links
-   ========================================================================== */
-
-/*
- * Addresses `outline` inconsistency between Chrome and other browsers.
- */
-
-a:focus {
-    outline: thin dotted;
-}
-
-/*
- * Improves readability when focused and also mouse hovered in all browsers.
- */
-
-a:active,
-a:hover {
-    outline: 0;
-}
-
-/* ==========================================================================
-   Typography
-   ========================================================================== */
-
-/*
- * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
- * Safari 5, and Chrome.
- */
-
-h1 {
-    font-size: 2em;
-}
-
-/*
- * Addresses styling not present in IE 8/9, Safari 5, and Chrome.
- */
-
-abbr[title] {
-    border-bottom: 1px dotted;
-}
-
-/*
- * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
- */
-
-b,
-strong {
-    font-weight: bold;
-}
-
-/*
- * Addresses styling not present in Safari 5 and Chrome.
- */
-
-dfn {
-    font-style: italic;
-}
-
-/*
- * Addresses styling not present in IE 8/9.
- */
-
-mark {
-    background: #ff0;
-    color: #000;
-}
-
-
-/*
- * Corrects font family set oddly in Safari 5 and Chrome.
- */
-
-code,
-kbd,
-pre,
-samp {
-    font-family: monospace, serif;
-    font-size: 1em;
-}
-
-/*
- * Improves readability of pre-formatted text in all browsers.
- */
-
-pre {
-    white-space: pre;
-    white-space: pre-wrap;
-    word-wrap: break-word;
-}
-
-/*
- * Sets consistent quote types.
- */
-
-q {
-    quotes: "\201C" "\201D" "\2018" "\2019";
-}
-
-/*
- * Addresses inconsistent and variable font size in all browsers.
- */
-
-small {
-    font-size: 80%;
-}
-
-/*
- * Prevents `sub` and `sup` affecting `line-height` in all browsers.
- */
-
-sub,
-sup {
-    font-size: 75%;
-    line-height: 0;
-    position: relative;
-    vertical-align: baseline;
-}
-
-sup {
-    top: -0.5em;
-}
-
-sub {
-    bottom: -0.25em;
-}
-
-/* ==========================================================================
-   Embedded content
-   ========================================================================== */
-
-/*
- * Removes border when inside `a` element in IE 8/9.
- */
-
-img {
-    border: 0;
-}
-
-/*
- * Corrects overflow displayed oddly in IE 9.
- */
-
-svg:not(:root) {
-    overflow: hidden;
-}
-
-/* ==========================================================================
-   Figures
-   ========================================================================== */
-
-/*
- * Addresses margin not present in IE 8/9 and Safari 5.
- */
-
-figure {
-    margin: 0;
-}
-
-/* ==========================================================================
-   Forms
-   ========================================================================== */
-
-/*
- * Define consistent border, margin, and padding.
- */
-
-fieldset {
-    border: 1px solid #c0c0c0;
-    margin: 0 2px;
-    padding: 0.35em 0.625em 0.75em;
-}
-
-/*
- * 1. Corrects color not being inherited in IE 8/9.
- * 2. Remove padding so people aren't caught out if they zero out fieldsets.
- */
-
-legend {
-    border: 0; /* 1 */
-    padding: 0; /* 2 */
-}
-
-/*
- * 1. Corrects font family not being inherited in all browsers.
- * 2. Corrects font size not being inherited in all browsers.
- * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
- */
-
-button,
-input,
-select,
-textarea {
-    font-family: inherit; /* 1 */
-    font-size: 100%; /* 2 */
-    margin: 0; /* 3 */
-}
-
-/*
- * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
- * the UA stylesheet.
- */
-
-button,
-input {
-    line-height: normal;
-}
-
-/*
- * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
- *    and `video` controls.
- * 2. Corrects inability to style clickable `input` types in iOS.
- * 3. Improves usability and consistency of cursor style between image-type
- *    `input` and others.
- */
-
-button,
-html input[type="button"], /* 1 */
-input[type="reset"],
-input[type="submit"] {
-    -webkit-appearance: button; /* 2 */
-    cursor: pointer; /* 3 */
-}
-
-/*
- * Re-set default cursor for disabled elements.
- */
-
-button[disabled],
-input[disabled] {
-    cursor: default;
-}
-
-/*
- * 1. Addresses box sizing set to `content-box` in IE 8/9.
- * 2. Removes excess padding in IE 8/9.
- */
-
-input[type="checkbox"],
-input[type="radio"] {
-    box-sizing: border-box; /* 1 */
-    padding: 0; /* 2 */
-}
-
-/*
- * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
- * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
- *    (include `-moz` to future-proof).
- */
-
-input[type="search"] {
-    -webkit-appearance: textfield; /* 1 */
-    -moz-box-sizing: content-box;
-    -webkit-box-sizing: content-box; /* 2 */
-    box-sizing: content-box;
-}
-
-/*
- * Removes inner padding and search cancel button in Safari 5 and Chrome
- * on OS X.
- */
-
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
-    -webkit-appearance: none;
-}
-
-/*
- * Removes inner padding and border in Firefox 4+.
- */
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-    border: 0;
-    padding: 0;
-}
-
-/*
- * 1. Removes default vertical scrollbar in IE 8/9.
- * 2. Improves readability and alignment in all browsers.
- */
-
-textarea {
-    overflow: auto; /* 1 */
-    vertical-align: top; /* 2 */
-}
-
-/* ==========================================================================
-   Tables
-   ========================================================================== */
-
-/*
- * Remove most spacing between table cells.
- */
-
-table {
-    border-collapse: collapse;
-    border-spacing: 0;
-}
\ No newline at end of file
diff --git a/src/doc/source/stylesheets/solarized.css.scss b/src/doc/source/stylesheets/solarized.css.scss
deleted file mode 100644 (file)
index 0c76570..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-@import "colors";
-
-.highlight { background-color: $beige; color: #586E75 }
-.highlight .c { color: #93A1A1 } /* Comment */
-.highlight .err { color: #93A1A1 } /* Error */
-.highlight .g { color: #93A1A1 } /* Generic */
-.highlight .k { color: #859900 } /* Keyword */
-.highlight .l { color: #93A1A1 } /* Literal */
-.highlight .n { color: #CB4B16 } /* Name */
-.highlight .o { color: #859900 } /* Operator */
-.highlight .x { color: #CB4B16 } /* Other */
-.highlight .p { color: #586E75 } /* Punctuation */
-.highlight .cm { color: #586E75 } /* Comment.Multiline */
-.highlight .cp { color: #859900 } /* Comment.Preproc */
-.highlight .c1 { color: #586E75 } /* Comment.Single */
-.highlight .cs { color: #859900 } /* Comment.Special */
-.highlight .gd { color: #2AA198 } /* Generic.Deleted */
-.highlight .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */
-.highlight .gr { color: #DC322F } /* Generic.Error */
-.highlight .gh { color: #CB4B16 } /* Generic.Heading */
-.highlight .gi { color: #859900 } /* Generic.Inserted */
-.highlight .go { color: #93A1A1 } /* Generic.Output */
-.highlight .gp { color: #93A1A1 } /* Generic.Prompt */
-.highlight .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */
-.highlight .gu { color: #CB4B16 } /* Generic.Subheading */
-.highlight .gt { color: #93A1A1 } /* Generic.Traceback */
-.highlight .kc { color: #CB4B16 } /* Keyword.Constant */
-.highlight .kd { color: #268BD2 } /* Keyword.Declaration */
-.highlight .kn { color: #859900 } /* Keyword.Namespace */
-.highlight .kp { color: #859900 } /* Keyword.Pseudo */
-.highlight .kr { color: #268BD2 } /* Keyword.Reserved */
-.highlight .kt { color: #DC322F } /* Keyword.Type */
-.highlight .ld { color: #93A1A1 } /* Literal.Date */
-.highlight .m { color: #2AA198 } /* Literal.Number */
-.highlight .s { color: #2AA198 } /* Literal.String */
-.highlight .na { color: #93A1A1 } /* Name.Attribute */
-.highlight .nb { color: #B58900 } /* Name.Builtin */
-.highlight .nc { color: #268BD2 } /* Name.Class */
-.highlight .no { color: #CB4B16 } /* Name.Constant */
-.highlight .nd { color: #268BD2 } /* Name.Decorator */
-.highlight .ni { color: #CB4B16 } /* Name.Entity */
-.highlight .ne { color: #CB4B16 } /* Name.Exception */
-.highlight .nf { color: #268BD2 } /* Name.Function */
-.highlight .nl { color: #93A1A1 } /* Name.Label */
-.highlight .nn { color: #CB4B16 } /* Name.Namespace */
-.highlight .nx { color: #93A1A1 } /* Name.Other */
-.highlight .py { color: #268BD2 } /* Name.Property */
-.highlight .nt { color: #268BD2 } /* Name.Tag */
-.highlight .nv { color: #268BD2 } /* Name.Variable */
-.highlight .ow { color: #859900 } /* Operator.Word */
-.highlight .w { color: #93A1A1 } /* Text.Whitespace */
-.highlight .mf { color: #2AA198 } /* Literal.Number.Float */
-.highlight .mh { color: #2AA198 } /* Literal.Number.Hex */
-.highlight .mi { color: #2AA198 } /* Literal.Number.Integer */
-.highlight .mo { color: #2AA198 } /* Literal.Number.Oct */
-.highlight .sb { color: #586E75 } /* Literal.String.Backtick */
-.highlight .sc { color: #2AA198 } /* Literal.String.Char */
-.highlight .sd { color: #93A1A1 } /* Literal.String.Doc */
-.highlight .s2 { color: #2AA198 } /* Literal.String.Double */
-.highlight .se { color: #CB4B16 } /* Literal.String.Escape */
-.highlight .sh { color: #93A1A1 } /* Literal.String.Heredoc */
-.highlight .si { color: #2AA198 } /* Literal.String.Interpol */
-.highlight .sx { color: #2AA198 } /* Literal.String.Other */
-.highlight .sr { color: #DC322F } /* Literal.String.Regex */
-.highlight .s1 { color: #2AA198 } /* Literal.String.Single */
-.highlight .ss { color: #2AA198 } /* Literal.String.Symbol */
-.highlight .bp { color: #268BD2 } /* Name.Builtin.Pseudo */
-.highlight .vc { color: #268BD2 } /* Name.Variable.Class */
-.highlight .vg { color: #268BD2 } /* Name.Variable.Global */
-.highlight .vi { color: #268BD2 } /* Name.Variable.Instance */
-.highlight .il { color: #2AA198 } /* Literal.Number.Integer.Long */
diff --git a/src/doc/stylesheets/all.css b/src/doc/stylesheets/all.css
new file mode 100644 (file)
index 0000000..2fbdf3a
--- /dev/null
@@ -0,0 +1,147 @@
+html {
+  background: url("../images/noise.png");
+  background-color: #3b6837;
+}
+
+body {
+  font-family: sans-serif;
+}
+
+* {
+  box-sizing: border-box;
+}
+
+body {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+a { color: #f3bb00; }
+a:hover { color: #b64790; }
+
+h1 {
+  font-size: 24px;
+  margin: 20px 0 10px 0;
+  font-weight: bold;
+  color: #b64790;
+}
+
+h1 code:not(.highlight) {
+  color: #d9a700;
+  vertical-align: bottom;
+}
+h1 a, h2 a { color: #b64790; text-decoration: none; }
+h1:hover a:after,
+h2:hover a:after{ content: '\2002\00a7\2002'; }
+h1.title { display: none; } /* hide rustdoc-generated title */
+:target { background: rgba(239, 242, 178, 1); padding: 5px; }
+
+h2 {
+  font-size: 18px;
+  margin: 15px 0 5px 0;
+  color: #b64790;
+  font-weight: bold;
+}
+
+h2 code:not(.highlight) { color: #d9a700; }
+
+code:not(.highlight) {
+  font-family: monospace;
+  color: #b64790;
+}
+
+main {
+  display: flex;
+  flex-direction: column;
+
+  max-width: 900px;
+  margin-bottom: 10px;
+
+  background-color: #f9f7ec;
+  padding: 15px;
+  border-radius: 5px;
+  box-shadow: 0px 0px 5px 2px #3b6837;
+}
+
+main p:first-child {
+  color: #199b5c;
+  font-weight: 500;
+  margin-top: 3px;
+  padding-bottom: 15px;
+  border-bottom: 1px solid #62865f;
+  text-align: center;
+}
+
+main p:first-child a { color: #3b6837; }
+main p:first-child a:hover { color: #62865f; }
+
+main p, main ul {
+  color: #3b6837;
+  margin: 10px 0;
+  line-height: 150%;
+}
+
+main ul { margin-left: 20px; }
+main li { list-style-type: disc; }
+main strong { font-weight: bold; }
+
+img.logo {
+  align-self: center;
+  margin-bottom: 10px;
+}
+
+pre {
+  padding: 10px;
+  margin: 10px 0;
+  border: 1px solid #cad0d0;
+  border-radius: 4px;
+  max-width: calc(100vw - 45px);
+  overflow-x: auto;
+
+  /* override prism.js styles for fonts */
+  font-size: 1em !important;
+  background: #eeecdd !important;
+}
+
+footer {
+  margin-top: 10px;
+  border-top: 1px solid #b64790;
+  padding-top: 10px;
+  width: 100%;
+  text-align: center;
+
+}
+footer a {
+  color: #b64790;
+  text-decoration: none;
+}
+footer a:hover {
+  text-decoration: underline;
+}
+
+.headerlink {
+  display: none;
+  text-decoration: none;
+}
+
+.fork-me {
+  position:absolute;
+  top:0;
+  right:0;
+}
+
+.token.toml-section { color: #CB4B16; }
+.token.toml-key { color: #268BD2; }
+
+/* Rust code highlighting */
+pre.rust .kw { color: #8959A8; }
+pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
+pre.rust .number, pre.rust .string { color: #718C00; }
+pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
+pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
+pre.rust .comment { color: #8E908C; }
+pre.rust .doccomment { color: #4D4D4C; }
+pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
+pre.rust .lifetime { color: #B76514; }
+code span.s1 { color: #2AA198; }
diff --git a/src/doc/stylesheets/normalize.css b/src/doc/stylesheets/normalize.css
new file mode 100644 (file)
index 0000000..73abb76
--- /dev/null
@@ -0,0 +1,375 @@
+/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
+
+/* ==========================================================================
+   HTML5 display definitions
+   ========================================================================== */
+
+/*
+ * Corrects `block` display not defined in IE 8/9.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section,
+summary {
+    display: block;
+}
+
+/*
+ * Corrects `inline-block` display not defined in IE 8/9.
+ */
+
+audio,
+canvas,
+video {
+    display: inline-block;
+}
+
+/*
+ * Prevents modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+    display: none;
+    height: 0;
+}
+
+/*
+ * Addresses styling for `hidden` attribute not present in IE 8/9.
+ */
+
+[hidden] {
+    display: none;
+}
+
+/* ==========================================================================
+   Base
+   ========================================================================== */
+
+/*
+ * 1. Sets default font family to sans-serif.
+ * 2. Prevents iOS text size adjust after orientation change, without disabling
+ *    user zoom.
+ */
+
+html {
+    font-family: sans-serif; /* 1 */
+    -webkit-text-size-adjust: 100%; /* 2 */
+    -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/*
+ * Removes default margin.
+ */
+
+body {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Links
+   ========================================================================== */
+
+/*
+ * Addresses `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+    outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+    outline: 0;
+}
+
+/* ==========================================================================
+   Typography
+   ========================================================================== */
+
+/*
+ * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
+ * Safari 5, and Chrome.
+ */
+
+h1 {
+    font-size: 2em;
+}
+
+/*
+ * Addresses styling not present in IE 8/9, Safari 5, and Chrome.
+ */
+
+abbr[title] {
+    border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
+ */
+
+b,
+strong {
+    font-weight: bold;
+}
+
+/*
+ * Addresses styling not present in Safari 5 and Chrome.
+ */
+
+dfn {
+    font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE 8/9.
+ */
+
+mark {
+    background: #ff0;
+    color: #000;
+}
+
+
+/*
+ * Corrects font family set oddly in Safari 5 and Chrome.
+ */
+
+code,
+kbd,
+pre,
+samp {
+    font-family: monospace, serif;
+    font-size: 1em;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers.
+ */
+
+pre {
+    white-space: pre;
+    white-space: pre-wrap;
+    word-wrap: break-word;
+}
+
+/*
+ * Sets consistent quote types.
+ */
+
+q {
+    quotes: "\201C" "\201D" "\2018" "\2019";
+}
+
+/*
+ * Addresses inconsistent and variable font size in all browsers.
+ */
+
+small {
+    font-size: 80%;
+}
+
+/*
+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+    font-size: 75%;
+    line-height: 0;
+    position: relative;
+    vertical-align: baseline;
+}
+
+sup {
+    top: -0.5em;
+}
+
+sub {
+    bottom: -0.25em;
+}
+
+/* ==========================================================================
+   Embedded content
+   ========================================================================== */
+
+/*
+ * Removes border when inside `a` element in IE 8/9.
+ */
+
+img {
+    border: 0;
+}
+
+/*
+ * Corrects overflow displayed oddly in IE 9.
+ */
+
+svg:not(:root) {
+    overflow: hidden;
+}
+
+/* ==========================================================================
+   Figures
+   ========================================================================== */
+
+/*
+ * Addresses margin not present in IE 8/9 and Safari 5.
+ */
+
+figure {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Forms
+   ========================================================================== */
+
+/*
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+    border: 1px solid #c0c0c0;
+    margin: 0 2px;
+    padding: 0.35em 0.625em 0.75em;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE 8/9.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+    border: 0; /* 1 */
+    padding: 0; /* 2 */
+}
+
+/*
+ * 1. Corrects font family not being inherited in all browsers.
+ * 2. Corrects font size not being inherited in all browsers.
+ * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
+ */
+
+button,
+input,
+select,
+textarea {
+    font-family: inherit; /* 1 */
+    font-size: 100%; /* 2 */
+    margin: 0; /* 3 */
+}
+
+/*
+ * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+button,
+input {
+    line-height: normal;
+}
+
+/*
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ *    and `video` controls.
+ * 2. Corrects inability to style clickable `input` types in iOS.
+ * 3. Improves usability and consistency of cursor style between image-type
+ *    `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+    -webkit-appearance: button; /* 2 */
+    cursor: pointer; /* 3 */
+}
+
+/*
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+input[disabled] {
+    cursor: default;
+}
+
+/*
+ * 1. Addresses box sizing set to `content-box` in IE 8/9.
+ * 2. Removes excess padding in IE 8/9.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+    box-sizing: border-box; /* 1 */
+    padding: 0; /* 2 */
+}
+
+/*
+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
+ *    (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+    -webkit-appearance: textfield; /* 1 */
+    -moz-box-sizing: content-box;
+    -webkit-box-sizing: content-box; /* 2 */
+    box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding and search cancel button in Safari 5 and Chrome
+ * on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+    -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+    border: 0;
+    padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE 8/9.
+ * 2. Improves readability and alignment in all browsers.
+ */
+
+textarea {
+    overflow: auto; /* 1 */
+    vertical-align: top; /* 2 */
+}
+
+/* ==========================================================================
+   Tables
+   ========================================================================== */
+
+/*
+ * Remove most spacing between table cells.
+ */
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
\ No newline at end of file
diff --git a/src/doc/stylesheets/prism.css b/src/doc/stylesheets/prism.css
new file mode 100644 (file)
index 0000000..6cc4523
--- /dev/null
@@ -0,0 +1,133 @@
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+       color: black;
+       text-shadow: 0 1px white;
+       font-family: Consolas, Monaco, 'Andale Mono', monospace;
+       direction: ltr;
+       text-align: left;
+       white-space: pre;
+       word-spacing: normal;
+       word-break: normal;
+       line-height: 1.5;
+
+       -moz-tab-size: 4;
+       -o-tab-size: 4;
+       tab-size: 4;
+
+       -webkit-hyphens: none;
+       -moz-hyphens: none;
+       -ms-hyphens: none;
+       hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
+       text-shadow: none;
+       background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
+code[class*="language-"]::selection, code[class*="language-"] ::selection {
+       text-shadow: none;
+       background: #b3d4fc;
+}
+
+@media print {
+       code[class*="language-"],
+       pre[class*="language-"] {
+               text-shadow: none;
+       }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+       padding: 1em;
+       margin: .5em 0;
+       overflow: auto;
+}
+
+:not(pre) > code[class*="language-"],
+pre[class*="language-"] {
+       background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+       padding: .1em;
+       border-radius: .3em;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+       color: slategray;
+}
+
+.token.punctuation {
+       color: #999;
+}
+
+.namespace {
+       opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+       color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+       color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string,
+.token.variable {
+       color: #a67f59;
+       background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+       color: #07a;
+}
+
+.token.function {
+       color: #DD4A68;
+}
+
+.token.regex,
+.token.important {
+       color: #e90;
+}
+
+.token.important {
+       font-weight: bold;
+}
+
+.token.entity {
+       cursor: help;
+}
+